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