Class: Skyscanner::Place
- Inherits:
-
Object
- Object
- Skyscanner::Place
- Defined in:
- lib/movlog/route.rb
Overview
Place info
Instance Attribute Summary collapse
-
#city_name ⇒ Object
readonly
Returns the value of attribute city_name.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Place
constructor
A new instance of Place.
- #to_hash ⇒ Object
Constructor Details
#initialize(data) ⇒ Place
Returns a new instance of Place.
55 56 57 58 59 60 |
# File 'lib/movlog/route.rb', line 55 def initialize(data) @name = data['Name'] @city_name = data['CityName'] @country_name = data['CountryName'] @type = data['Type'] end |
Instance Attribute Details
#city_name ⇒ Object (readonly)
Returns the value of attribute city_name.
52 53 54 |
# File 'lib/movlog/route.rb', line 52 def city_name @city_name end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name.
52 53 54 |
# File 'lib/movlog/route.rb', line 52 def country_name @country_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
52 53 54 |
# File 'lib/movlog/route.rb', line 52 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
53 54 55 |
# File 'lib/movlog/route.rb', line 53 def type @type end |
Class Method Details
.find(data) ⇒ Object
62 63 64 |
# File 'lib/movlog/route.rb', line 62 def self.find(data) new(data) end |
Instance Method Details
#to_hash ⇒ Object
66 67 68 69 |
# File 'lib/movlog/route.rb', line 66 def to_hash { name: @name, city_name: @city_name, country_name: @country_name, type: @type } end |