Class: Manateq::Region

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/manateq/region.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Resource

included

Instance Attribute Details

#arabic_nameObject

Returns the value of attribute arabic_name.



7
8
9
# File 'lib/manateq/region.rb', line 7

def arabic_name
  @arabic_name
end

#english_nameObject

Returns the value of attribute english_name.



8
9
10
# File 'lib/manateq/region.rb', line 8

def english_name
  @english_name
end

#idObject

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_nameObject



10
11
12
# File 'lib/manateq/region.rb', line 10

def self.resource_name
  'regions'
end