Class: Run
- Inherits:
-
Object
- Object
- Run
- Defined in:
- lib/model/run.rb
Instance Attribute Summary collapse
-
#destination_id ⇒ Object
readonly
Returns the value of attribute destination_id.
-
#destination_name ⇒ Object
readonly
Returns the value of attribute destination_name.
-
#run_id ⇒ Object
readonly
Returns the value of attribute run_id.
-
#transport_type ⇒ Object
readonly
Returns the value of attribute transport_type.
Instance Method Summary collapse
-
#initialize(run) ⇒ Run
constructor
A new instance of Run.
Constructor Details
#initialize(run) ⇒ Run
Returns a new instance of Run.
7 8 9 10 11 12 |
# File 'lib/model/run.rb', line 7 def initialize run @transport_type = TransportType.from_s run.delete("transport_type") run.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#destination_id ⇒ Object (readonly)
Returns the value of attribute destination_id.
5 6 7 |
# File 'lib/model/run.rb', line 5 def destination_id @destination_id end |
#destination_name ⇒ Object (readonly)
Returns the value of attribute destination_name.
5 6 7 |
# File 'lib/model/run.rb', line 5 def destination_name @destination_name end |
#run_id ⇒ Object (readonly)
Returns the value of attribute run_id.
5 6 7 |
# File 'lib/model/run.rb', line 5 def run_id @run_id end |
#transport_type ⇒ Object (readonly)
Returns the value of attribute transport_type.
5 6 7 |
# File 'lib/model/run.rb', line 5 def transport_type @transport_type end |