Class: Stop

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'lib/model/stop.rb', line 6

def location
  @location
end

#location_nameObject (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_idObject (readonly)

Returns the value of attribute stop_id.



6
7
8
# File 'lib/model/stop.rb', line 6

def stop_id
  @stop_id
end

#suburbObject (readonly)

Returns the value of attribute suburb.



6
7
8
# File 'lib/model/stop.rb', line 6

def suburb
  @suburb
end

#transport_typeObject (readonly)

Returns the value of attribute transport_type.



6
7
8
# File 'lib/model/stop.rb', line 6

def transport_type
  @transport_type
end