Class: Pumi::Location
- Inherits:
-
Struct
- Object
- Struct
- Pumi::Location
- Defined in:
- lib/pumi/location.rb
Class Attribute Summary collapse
-
.data_store_key ⇒ Object
Returns the value of attribute data_store_key.
Instance Attribute Summary collapse
-
#address_en ⇒ Object
Returns the value of attribute address_en.
-
#address_km ⇒ Object
Returns the value of attribute address_km.
-
#address_latin ⇒ Object
Returns the value of attribute address_latin.
-
#administrative_unit ⇒ Object
Returns the value of attribute administrative_unit.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#commune ⇒ Object
Returns the value of attribute commune.
-
#commune_id ⇒ Object
Returns the value of attribute commune_id.
-
#district ⇒ Object
Returns the value of attribute district.
-
#district_id ⇒ Object
Returns the value of attribute district_id.
-
#full_name_en ⇒ Object
Returns the value of attribute full_name_en.
-
#full_name_km ⇒ Object
Returns the value of attribute full_name_km.
-
#full_name_latin ⇒ Object
Returns the value of attribute full_name_latin.
-
#full_name_ungegn ⇒ Object
Returns the value of attribute full_name_ungegn.
-
#geodata ⇒ Object
Returns the value of attribute geodata.
-
#id ⇒ Object
Returns the value of attribute id.
-
#iso3166_2 ⇒ Object
Returns the value of attribute iso3166_2.
-
#links ⇒ Object
Returns the value of attribute links.
-
#name_en ⇒ Object
Returns the value of attribute name_en.
-
#name_km ⇒ Object
Returns the value of attribute name_km.
-
#name_latin ⇒ Object
Returns the value of attribute name_latin.
-
#name_ungegn ⇒ Object
Returns the value of attribute name_ungegn.
-
#province ⇒ Object
Returns the value of attribute province.
-
#province_id ⇒ Object
Returns the value of attribute province_id.
-
#village_id ⇒ Object
Returns the value of attribute village_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(attributes) ⇒ Location
Returns a new instance of Location.
42 43 44 45 |
# File 'lib/pumi/location.rb', line 42 def initialize(attributes) @attributes = attributes super end |
Class Attribute Details
.data_store_key ⇒ Object
Returns the value of attribute data_store_key.
17 18 19 |
# File 'lib/pumi/location.rb', line 17 def data_store_key @data_store_key end |
Instance Attribute Details
#address_en ⇒ Object
Returns the value of attribute address_en
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def address_en @address_en end |
#address_km ⇒ Object
Returns the value of attribute address_km
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def address_km @address_km end |
#address_latin ⇒ Object
Returns the value of attribute address_latin
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def address_latin @address_latin end |
#administrative_unit ⇒ Object
Returns the value of attribute administrative_unit
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def administrative_unit @administrative_unit end |
#attributes ⇒ Object
Returns the value of attribute attributes.
40 41 42 |
# File 'lib/pumi/location.rb', line 40 def attributes @attributes end |
#commune ⇒ Object
Returns the value of attribute commune
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def commune @commune end |
#commune_id ⇒ Object
Returns the value of attribute commune_id
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def commune_id @commune_id end |
#district ⇒ Object
Returns the value of attribute district
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def district @district end |
#district_id ⇒ Object
Returns the value of attribute district_id
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def district_id @district_id end |
#full_name_en ⇒ Object
Returns the value of attribute full_name_en
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def full_name_en @full_name_en end |
#full_name_km ⇒ Object
Returns the value of attribute full_name_km
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def full_name_km @full_name_km end |
#full_name_latin ⇒ Object
Returns the value of attribute full_name_latin
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def full_name_latin @full_name_latin end |
#full_name_ungegn ⇒ Object
Returns the value of attribute full_name_ungegn
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def full_name_ungegn @full_name_ungegn end |
#geodata ⇒ Object
Returns the value of attribute geodata
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def geodata @geodata end |
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def id @id end |
#iso3166_2 ⇒ Object
Returns the value of attribute iso3166_2
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def iso3166_2 @iso3166_2 end |
#links ⇒ Object
Returns the value of attribute links
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def links @links end |
#name_en ⇒ Object
Returns the value of attribute name_en
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def name_en @name_en end |
#name_km ⇒ Object
Returns the value of attribute name_km
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def name_km @name_km end |
#name_latin ⇒ Object
Returns the value of attribute name_latin
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def name_latin @name_latin end |
#name_ungegn ⇒ Object
Returns the value of attribute name_ungegn
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def name_ungegn @name_ungegn end |
#province ⇒ Object
Returns the value of attribute province
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def province @province end |
#province_id ⇒ Object
Returns the value of attribute province_id
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def province_id @province_id end |
#village_id ⇒ Object
Returns the value of attribute village_id
2 3 4 |
# File 'lib/pumi/location.rb', line 2 def village_id @village_id end |
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/pumi/location.rb', line 19 def all data.values end |
.find_by_id(id) ⇒ Object
23 24 25 |
# File 'lib/pumi/location.rb', line 23 def find_by_id(id) data[id] end |
.where(params) ⇒ Object
27 28 29 30 31 |
# File 'lib/pumi/location.rb', line 27 def where(params) data.values.select do |location| (params.transform_keys(&:to_s).to_a - location.attributes.transform_keys(&:to_s).to_a).empty? end end |