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.



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_nameObject (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_nameObject (readonly)

Returns the value of attribute country_name.



52
53
54
# File 'lib/movlog/route.rb', line 52

def country_name
  @country_name
end

#nameObject (readonly)

Returns the value of attribute name.



52
53
54
# File 'lib/movlog/route.rb', line 52

def name
  @name
end

#typeObject (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_hashObject



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