Class: Manateq::District
- Inherits:
-
Object
- Object
- Manateq::District
- Includes:
- Resource
- Defined in:
- lib/manateq/district.rb
Instance Attribute Summary collapse
-
#arabic_name ⇒ Object
Returns the value of attribute arabic_name.
-
#city ⇒ Object
Returns the value of attribute city.
-
#english_name ⇒ Object
Returns the value of attribute english_name.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Methods included from Resource
Instance Attribute Details
#arabic_name ⇒ Object
Returns the value of attribute arabic_name.
6 7 8 |
# File 'lib/manateq/district.rb', line 6 def arabic_name @arabic_name end |
#city ⇒ Object
Returns the value of attribute city.
8 9 10 |
# File 'lib/manateq/district.rb', line 8 def city @city end |
#english_name ⇒ Object
Returns the value of attribute english_name.
7 8 9 |
# File 'lib/manateq/district.rb', line 7 def english_name @english_name end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/manateq/district.rb', line 5 def id @id end |
Class Method Details
.compare(resource, name) ⇒ Object
23 24 25 26 |
# File 'lib/manateq/district.rb', line 23 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
14 15 16 17 18 19 20 21 |
# File 'lib/manateq/district.rb', line 14 def self.fill data r_obj = self.new r_obj.id = data['district_id'] r_obj.arabic_name = data['name']['ar'] r_obj.english_name = data['name']['en'] r_obj.city = Manateq::Region.get_by_id data['city_id'] r_obj end |
.resource_name ⇒ Object
10 11 12 |
# File 'lib/manateq/district.rb', line 10 def self.resource_name 'districts' end |