Class: Stop
- Inherits:
-
Object
- Object
- Stop
- Defined in:
- lib/model/stop.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#location_name ⇒ Object
readonly
Returns the value of attribute location_name.
-
#stop_id ⇒ Object
readonly
Returns the value of attribute stop_id.
-
#suburb ⇒ Object
readonly
Returns the value of attribute suburb.
-
#transport_type ⇒ Object
readonly
Returns the value of attribute transport_type.
Instance Method Summary collapse
-
#initialize(args) ⇒ Stop
constructor
A new instance of Stop.
Constructor Details
#initialize(args) ⇒ Stop
Returns a new instance of Stop.
8 9 10 11 12 13 14 |
# File 'lib/model/stop.rb', line 8 def initialize(args) @transport_type = TransportType.from_s args.delete("transport_type") @location = Location.new(args.delete("lat"), args.delete("long")) args.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/model/stop.rb', line 6 def location @location end |
#location_name ⇒ Object (readonly)
Returns the value of attribute location_name.
6 7 8 |
# File 'lib/model/stop.rb', line 6 def location_name @location_name end |
#stop_id ⇒ Object (readonly)
Returns the value of attribute stop_id.
6 7 8 |
# File 'lib/model/stop.rb', line 6 def stop_id @stop_id end |
#suburb ⇒ Object (readonly)
Returns the value of attribute suburb.
6 7 8 |
# File 'lib/model/stop.rb', line 6 def suburb @suburb end |
#transport_type ⇒ Object (readonly)
Returns the value of attribute transport_type.
6 7 8 |
# File 'lib/model/stop.rb', line 6 def transport_type @transport_type end |