Class: EmtApi::Line
- Inherits:
-
Object
- Object
- EmtApi::Line
- Defined in:
- lib/emt_api/line.rb
Instance Attribute Summary collapse
-
#date_end ⇒ Object
Returns the value of attribute date_end.
-
#date_first ⇒ Object
Returns the value of attribute date_first.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#group_number ⇒ Object
Returns the value of attribute group_number.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#origin ⇒ Object
Returns the value of attribute origin.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(line_data = {}) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(line_data = {}) ⇒ Line
Returns a new instance of Line.
8 9 10 11 12 13 14 15 16 |
# File 'lib/emt_api/line.rb', line 8 def initialize(line_data = {}) @id = line_data['line'] @label = line_data['label'] @group_number = line_data['groupNumber'].to_i @date_first = EmtApi::Parser.parse_date line_data['dateFirst'] @date_end = EmtApi::Parser.parse_date line_data['dateEnd'] @origin = EmtApi::Parser.parse_sentence line_data['nameA'] @destination = EmtApi::Parser.parse_sentence line_data['nameB'] end |
Instance Attribute Details
#date_end ⇒ Object
Returns the value of attribute date_end.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def date_end @date_end end |
#date_first ⇒ Object
Returns the value of attribute date_first.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def date_first @date_first end |
#destination ⇒ Object
Returns the value of attribute destination.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def destination @destination end |
#group_number ⇒ Object
Returns the value of attribute group_number.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def group_number @group_number end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def id @id end |
#label ⇒ Object
Returns the value of attribute label.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def label @label end |
#origin ⇒ Object
Returns the value of attribute origin.
6 7 8 |
# File 'lib/emt_api/line.rb', line 6 def origin @origin end |