Class: Rome2rio::SearchResponse
- Inherits:
-
Object
- Object
- Rome2rio::SearchResponse
- Defined in:
- lib/rome2rio/response/search_response.rb
Instance Attribute Summary collapse
-
#agencies ⇒ Object
readonly
Returns the value of attribute agencies.
-
#aircrafts ⇒ Object
readonly
Returns the value of attribute aircrafts.
-
#airlines ⇒ Object
readonly
Returns the value of attribute airlines.
-
#airports ⇒ Object
readonly
Returns the value of attribute airports.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
-
#verbatim ⇒ Object
readonly
Returns the value of attribute verbatim.
Instance Method Summary collapse
-
#initialize(json) ⇒ SearchResponse
constructor
A new instance of SearchResponse.
Constructor Details
#initialize(json) ⇒ SearchResponse
Returns a new instance of SearchResponse.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rome2rio/response/search_response.rb', line 4 def initialize(json) @verbatim = json @agencies = [] json["agencies"].each { |agency| @agencies << Agency.new(agency) } @airlines = [] json["airlines"].each { |airline| @airlines << Airline.new(airline) } @aircrafts = [] json["aircrafts"].each { |aircraft| @aircrafts << Aircraft.new(aircraft) } @airports = [] json["airports"].each { |airport| @airports << Airport.new(airport) } @routes = [] json["routes"].each { |route| @routes << Route.new(route) } @data = json["data"] end |
Instance Attribute Details
#agencies ⇒ Object (readonly)
Returns the value of attribute agencies.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def agencies @agencies end |
#aircrafts ⇒ Object (readonly)
Returns the value of attribute aircrafts.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def aircrafts @aircrafts end |
#airlines ⇒ Object (readonly)
Returns the value of attribute airlines.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def airlines @airlines end |
#airports ⇒ Object (readonly)
Returns the value of attribute airports.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def airports @airports end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def data @data end |
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def routes @routes end |
#verbatim ⇒ Object (readonly)
Returns the value of attribute verbatim.
3 4 5 |
# File 'lib/rome2rio/response/search_response.rb', line 3 def verbatim @verbatim end |