Class: Metromobilite::Model::Stop

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, times) ⇒ Stop

Returns a new instance of Stop.



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

def initialize(pattern, times)
    @pattern = pattern
    @times = times
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



11
12
13
# File 'lib/metromobilite/model/stop.rb', line 11

def pattern
  @pattern
end

#timesObject (readonly)

Returns the value of attribute times.



12
13
14
# File 'lib/metromobilite/model/stop.rb', line 12

def times
  @times
end

Instance Method Details

#to_json(opts = nil) ⇒ Object



14
15
16
17
18
# File 'lib/metromobilite/model/stop.rb', line 14

def to_json(opts = nil)
    hash = {}
    instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) }
    hash.to_json
end