Class: WorldBank::Region
- Inherits:
-
Object
- Object
- WorldBank::Region
- Defined in:
- lib/world_bank/region.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(values = {}) ⇒ Region
constructor
A new instance of Region.
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/world_bank/region.rb', line 4 def code @code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/world_bank/region.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/world_bank/region.rb', line 4 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
4 5 6 |
# File 'lib/world_bank/region.rb', line 4 def raw @raw end |
#type ⇒ Object (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
.all ⇒ Object
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 |