Class: Skyscanner::Route
- Inherits:
-
Object
- Object
- Skyscanner::Route
- Defined in:
- lib/movlog/route.rb
Overview
Route info
Instance Attribute Summary collapse
-
#flights ⇒ Object
readonly
Returns the value of attribute flights.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Route
constructor
A new instance of Route.
- #to_hash ⇒ Object
Constructor Details
#initialize(data) ⇒ Route
Returns a new instance of Route.
9 10 11 12 |
# File 'lib/movlog/route.rb', line 9 def initialize(data) = RouteMeta.new(data[:meta]) @flights = data[:flights] end |
Instance Attribute Details
#flights ⇒ Object (readonly)
Returns the value of attribute flights.
7 8 9 |
# File 'lib/movlog/route.rb', line 7 def flights @flights end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
6 7 8 |
# File 'lib/movlog/route.rb', line 6 def end |
Class Method Details
.find(meta) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/movlog/route.rb', line 14 def self.find() route_info = RouteInfo.find() data = { meta: , flights: route_info.parse_flights } new(data) end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 |
# File 'lib/movlog/route.rb', line 23 def to_hash { meta: .to_hash, flights: @flights.to_hash } end |