Class: LineItem

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/line_item.rb

Instance Method Summary collapse

Instance Method Details

#assign_item=(value) ⇒ Object

Attributes



11
12
13
14
15
16
17
# File 'app/models/line_item.rb', line 11

def assign_item=(value)
  self.item = value

  self.price = value.price
  self.title = value.title
  self.code  = value.code
end

#total_amountObject



19
20
21
# File 'app/models/line_item.rb', line 19

def total_amount
  times * price.to_f
end