Class: Manateq::City
Instance Attribute Summary collapse
-
#arabic_name ⇒ Object
Returns the value of attribute arabic_name.
-
#english_name ⇒ Object
Returns the value of attribute english_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#region ⇒ Object
Returns the value of attribute region.
Class Method Summary collapse
Methods included from Resource
Instance Attribute Details
#arabic_name ⇒ Object
Returns the value of attribute arabic_name.
10 11 12 |
# File 'lib/manateq/city.rb', line 10 def arabic_name @arabic_name end |
#english_name ⇒ Object
Returns the value of attribute english_name.
11 12 13 |
# File 'lib/manateq/city.rb', line 11 def english_name @english_name end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/manateq/city.rb', line 8 def id @id end |
#region ⇒ Object
Returns the value of attribute region.
9 10 11 |
# File 'lib/manateq/city.rb', line 9 def region @region end |
Class Method Details
.compare(resource, name) ⇒ Object
26 27 28 29 |
# File 'lib/manateq/city.rb', line 26 def self.compare resource, name resource.arabic_name.downcase.index(name.downcase) != nil or resource.english_name.downcase.index(name.downcase) != nil end |
.fill(data) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/manateq/city.rb', line 17 def self.fill data r_obj = self.new r_obj.id = data['city_id'] r_obj.arabic_name = data['name']['ar'] r_obj.english_name = data['name']['en'] r_obj.region = Manateq::Region.get_by_id data['region_id'] r_obj end |
.resource_name ⇒ Object
13 14 15 |
# File 'lib/manateq/city.rb', line 13 def self.resource_name 'cities' end |