Class: PokelocParser::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/pokeloc_parser/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

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_atObject

Returns the value of attribute got_at.



48
49
50
# File 'lib/pokeloc_parser/parser.rb', line 48

def got_at
  @got_at
end

#numbersObject

Returns the value of attribute numbers.



48
49
50
# File 'lib/pokeloc_parser/parser.rb', line 48

def numbers
  @numbers
end

#stationObject

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_hObject



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_jsonObject



56
57
58
# File 'lib/pokeloc_parser/parser.rb', line 56

def to_json
  to_h.to_json
end