Class: Halffare::Model::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/halffare/model/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/halffare/model/order.rb', line 4

def description
  @description
end

#noteObject (readonly)

Returns the value of attribute note.



4
5
6
# File 'lib/halffare/model/order.rb', line 4

def note
  @note
end

#order_dateObject (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

#priceObject (readonly)

Returns the value of attribute price.



4
5
6
# File 'lib/halffare/model/order.rb', line 4

def price
  @price
end

#travel_dateObject (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