Class: WorldBank::Region

Inherits:
Object
  • Object
show all
Defined in:
lib/world_bank/region.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ Region

Returns a new instance of Region.



14
15
16
17
18
19
20
# File 'lib/world_bank/region.rb', line 14

def initialize(values={})
  @raw = values
  @id = values['id']
  @code = values['code']
  @name = values['name']
  @type = 'regions'
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/world_bank/region.rb', line 4

def code
  @code
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/world_bank/region.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/world_bank/region.rb', line 4

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw.



4
5
6
# File 'lib/world_bank/region.rb', line 4

def raw
  @raw
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/world_bank/region.rb', line 4

def type
  @type
end

Class Method Details

.allObject



6
7
8
# File 'lib/world_bank/region.rb', line 6

def self.all
  find('all')
end

.find(id) ⇒ Object



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

def self.find(id)
  WorldBank::ParamQuery.new('regions', id, self)
end