Class: SimpleInvoice::LineItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/simple_invoice/line_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



2
3
4
# File 'lib/simple_invoice/line_item.rb', line 2

def description
  @description
end

#priceObject

Returns the value of attribute price

Returns:

  • (Object)

    the current value of price



2
3
4
# File 'lib/simple_invoice/line_item.rb', line 2

def price
  @price
end

#quantityObject

Returns the value of attribute quantity

Returns:

  • (Object)

    the current value of quantity



2
3
4
# File 'lib/simple_invoice/line_item.rb', line 2

def quantity
  @quantity
end

Instance Method Details

#totalFixnum

Returns:

  • (Fixnum)


5
6
7
# File 'lib/simple_invoice/line_item.rb', line 5

def total
  price * quantity
end