I can’t understand Binding#receiver
I have same result with self:
class Cat
def self.type
binding.receiver
end
end
> Cat.type
Cat
class Tiger < Cat
end
> Tiger.type
Tiger
I can’t understand Binding#receiver
I have same result with self:
class Cat
def self.type
binding.receiver
end
end
> Cat.type
Cat
class Tiger < Cat
end
> Tiger.type
Tiger