Roderick van Domburg wrote:
>
> Can you post the source to either class?
cart_session.rb
class CartSession
attr :items
attr_accessor :building
attr_accessor :use_corporate_account
end
class CartSessionLineItem
attr_accessor :sku, :quantity, :sku_id
def initialize(sku_id, quantity)
@sku_id = sku_id
@sku = Sku.find(sku_id)
@quantity = quantity
end
def total
sku.skuable.price * quantity
end
end
> Also note that inheritance is not equal to derivation.
>
OK, I have to admit, I feel dumb here. I always thought inheriting from
a class was deriving from it. Is my terminology all messed up?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---