Class: WorldBank::Topic
- Inherits:
-
Object
- Object
- WorldBank::Topic
- Defined in:
- lib/world_bank/topic.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#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 = {}) ⇒ Topic
constructor
A new instance of Topic.
Constructor Details
#initialize(values = {}) ⇒ Topic
Returns a new instance of Topic.
15 16 17 18 19 20 21 |
# File 'lib/world_bank/topic.rb', line 15 def initialize(values={}) @raw = values @id = values['id'] @name = values['value'] @note = values['sourceNote'] @type = 'topics' end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/world_bank/topic.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/world_bank/topic.rb', line 5 def name @name end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
5 6 7 |
# File 'lib/world_bank/topic.rb', line 5 def note @note end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/world_bank/topic.rb', line 5 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/world_bank/topic.rb', line 5 def type @type end |
Class Method Details
.all ⇒ Object
7 8 9 |
# File 'lib/world_bank/topic.rb', line 7 def self.all find('all') end |
.find(id) ⇒ Object
11 12 13 |
# File 'lib/world_bank/topic.rb', line 11 def self.find(id) WorldBank::ParamQuery.new('topics', id, self) end |