Class: PokelocParser::Result
- Inherits:
-
Object
- Object
- PokelocParser::Result
- Defined in:
- lib/pokeloc_parser/parser.rb
Instance Attribute Summary collapse
-
#got_at ⇒ Object
Returns the value of attribute got_at.
-
#numbers ⇒ Object
Returns the value of attribute numbers.
-
#station ⇒ Object
Returns the value of attribute station.
Instance Method Summary collapse
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
49 50 51 |
# File 'lib/pokeloc_parser/parser.rb', line 49 def initialize @numbers = [] end |
Instance Attribute Details
#got_at ⇒ Object
Returns the value of attribute got_at.
48 49 50 |
# File 'lib/pokeloc_parser/parser.rb', line 48 def got_at @got_at end |
#numbers ⇒ Object
Returns the value of attribute numbers.
48 49 50 |
# File 'lib/pokeloc_parser/parser.rb', line 48 def numbers @numbers end |
#station ⇒ Object
Returns the value of attribute station.
48 49 50 |
# File 'lib/pokeloc_parser/parser.rb', line 48 def station @station end |
Instance Method Details
#to_h ⇒ Object
53 54 55 |
# File 'lib/pokeloc_parser/parser.rb', line 53 def to_h { station: station, got_at: got_at, numbers: numbers.map(&:to_h) } end |
#to_json ⇒ Object
56 57 58 |
# File 'lib/pokeloc_parser/parser.rb', line 56 def to_json to_h.to_json end |