Class: Metromobilite::Model::Stop
- Inherits:
-
Object
- Object
- Metromobilite::Model::Stop
- Defined in:
- lib/metromobilite/model/stop.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#times ⇒ Object
readonly
Returns the value of attribute times.
Instance Method Summary collapse
-
#initialize(pattern, times) ⇒ Stop
constructor
A new instance of Stop.
- #to_json(opts = nil) ⇒ Object
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
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
11 12 13 |
# File 'lib/metromobilite/model/stop.rb', line 11 def pattern @pattern end |
#times ⇒ Object (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 |