Sha256: f59a233382c7fed54ea540186823cff68449f454d4fdd03cbc488206f4eb602c

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

module Manateq
  class District
    include Manateq::Resource

    attr_accessor :id
    attr_accessor :arabic_name
    attr_accessor :english_name
    attr_accessor :city

    def self.resource_name
      'districts'
    end

    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

    def self.compare resource, name
      resource.arabic_name.downcase.index(name.downcase) != nil or
          resource.english_name.downcase.index(name.downcase) != nil
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
manateq-0.1.0 lib/manateq/district.rb