class Item
def name=(name_value)
@name = name_value
end
def name
@name
end
end
In the first case:
item = Item.new
item.name=("value")
puts item.class
I keep getting.
Item
In the second case:
item = Item.new.name=("value")
puts item.class
I have
String
Why? I do not understand the difference.