Class: Skyscanner::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/movlog/route.rb

Overview

Place info

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Place

Returns a new instance of Place.



59
60
61
62
63
64
# File 'lib/movlog/route.rb', line 59

def initialize(data)
  @name = data['Name']
  @city_name = data['CityName']
  @country_name = data['CountryName']
  @type = data['Type']
end

Instance Attribute Details

#city_nameObject (readonly)

Returns the value of attribute city_name.



56
57
58
# File 'lib/movlog/route.rb', line 56

def city_name
  @city_name
end

#country_nameObject (readonly)

Returns the value of attribute country_name.



56
57
58
# File 'lib/movlog/route.rb', line 56

def country_name
  @country_name
end

#nameObject (readonly)

Returns the value of attribute name.



56
57
58
# File 'lib/movlog/route.rb', line 56

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



57
58
59
# File 'lib/movlog/route.rb', line 57

def type
  @type
end

Class Method Details

.find(data) ⇒ Object



66
67
68
# File 'lib/movlog/route.rb', line 66

def self.find(data)
  new(data)
end

Instance Method Details

#to_hashObject



70
71
72
73
# File 'lib/movlog/route.rb', line 70

def to_hash
  { name: @name, city_name: @city_name, country_name: @country_name,
    type: @type }
end