Class: Halffare::Model::Order
- Inherits:
-
Object
- Object
- Halffare::Model::Order
- Defined in:
- lib/halffare/model/order.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#order_date ⇒ Object
readonly
Returns the value of attribute order_date.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#travel_date ⇒ Object
readonly
Returns the value of attribute travel_date.
Instance Method Summary collapse
- #from_row(row) ⇒ Object
-
#initialize(row) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(row) ⇒ Order
Returns a new instance of Order.
5 6 7 |
# File 'lib/halffare/model/order.rb', line 5 def initialize(row) from_row(row) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/halffare/model/order.rb', line 4 def description @description end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
4 5 6 |
# File 'lib/halffare/model/order.rb', line 4 def note @note end |
#order_date ⇒ Object (readonly)
Returns the value of attribute order_date.
4 5 6 |
# File 'lib/halffare/model/order.rb', line 4 def order_date @order_date end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
4 5 6 |
# File 'lib/halffare/model/order.rb', line 4 def price @price end |
#travel_date ⇒ Object (readonly)
Returns the value of attribute travel_date.
4 5 6 |
# File 'lib/halffare/model/order.rb', line 4 def travel_date @travel_date end |
Instance Method Details
#from_row(row) ⇒ Object
9 10 11 12 13 |
# File 'lib/halffare/model/order.rb', line 9 def from_row(row) @travel_date, @order_date, @price, @note, @description = row.split("|") @description.strip! @price = @price.to_f end |