Class: Manateq::Region
- Inherits:
-
Object
- Object
- Manateq::Region
- Includes:
- Resource
- Defined in:
- lib/manateq/region.rb
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.
Class Method Summary collapse
Methods included from Resource
Instance Attribute Details
#arabic_name ⇒ Object
Returns the value of attribute arabic_name.
7 8 9 |
# File 'lib/manateq/region.rb', line 7 def arabic_name @arabic_name end |
#english_name ⇒ Object
Returns the value of attribute english_name.
8 9 10 |
# File 'lib/manateq/region.rb', line 8 def english_name @english_name end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/manateq/region.rb', line 6 def id @id end |
Class Method Details
.compare(resource, name) ⇒ Object
22 23 24 25 |
# File 'lib/manateq/region.rb', line 22 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 |
# File 'lib/manateq/region.rb', line 14 def self.fill data r_obj = self.new r_obj.id = data['region_id'] r_obj.arabic_name = data['name']['ar'] r_obj.english_name = data['name']['en'] r_obj end |
.resource_name ⇒ Object
10 11 12 |
# File 'lib/manateq/region.rb', line 10 def self.resource_name 'regions' end |