Class: WorldBank::Indicator
- Inherits:
-
Object
- Object
- WorldBank::Indicator
- Defined in:
- lib/world_bank/indicator.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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#topics ⇒ Object
readonly
Returns the value of attribute topics.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
- .all ⇒ Object
- .country ⇒ Object
- .featured ⇒ Object
- .fetch(arg) ⇒ Object
- .find(id) ⇒ Object
- .format(arg) ⇒ Object
- .id(arg) ⇒ Object
- .income_level(arg) ⇒ Object
- .language(arg) ⇒ Object
- .lending_type(arg) ⇒ Object
- .most_recent_values(arg) ⇒ Object
- .page(arg) ⇒ Object
- .per_page ⇒ Object
- .region(arg) ⇒ Object
Instance Method Summary collapse
-
#initialize(values = {}) ⇒ Indicator
constructor
A new instance of Indicator.
Constructor Details
#initialize(values = {}) ⇒ Indicator
Returns a new instance of Indicator.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/world_bank/indicator.rb', line 63 def initialize(values={}) @raw = values @id = values['id'] @name = values['name'] @source = WorldBank::Source.new(values['source']) @note = values['sourceNote'] @organization = values['sourceOrganization'] @topics = [] values['topics'].each do |topic| @topics << WorldBank::Topic.new(topic) end @type = 'indicators' end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def name @name end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def note @note end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def organization @organization end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def raw @raw end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def source @source end |
#topics ⇒ Object (readonly)
Returns the value of attribute topics.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def topics @topics end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/world_bank/indicator.rb', line 5 def type @type end |
Class Method Details
.all ⇒ Object
55 56 57 |
# File 'lib/world_bank/indicator.rb', line 55 def self.all find('all') end |
.country ⇒ Object
43 44 45 |
# File 'lib/world_bank/indicator.rb', line 43 def self.country find('all').country(arg) end |
.featured ⇒ Object
51 52 53 |
# File 'lib/world_bank/indicator.rb', line 51 def self.featured find('all').featured_indicators end |
.fetch(arg) ⇒ Object
47 48 49 |
# File 'lib/world_bank/indicator.rb', line 47 def self.fetch(arg) find(arg).fetch end |
.find(id) ⇒ Object
59 60 61 |
# File 'lib/world_bank/indicator.rb', line 59 def self.find(id) WorldBank::ParamQuery.new('indicators', id, self) end |
.format(arg) ⇒ Object
7 8 9 |
# File 'lib/world_bank/indicator.rb', line 7 def self.format(arg) find('all').format(arg) end |
.id(arg) ⇒ Object
11 12 13 |
# File 'lib/world_bank/indicator.rb', line 11 def self.id(arg) find('all').id(arg) end |
.income_level(arg) ⇒ Object
31 32 33 |
# File 'lib/world_bank/indicator.rb', line 31 def self.income_level(arg) find('all').income_level(arg) end |
.language(arg) ⇒ Object
27 28 29 |
# File 'lib/world_bank/indicator.rb', line 27 def self.language(arg) find('all').language(arg) end |
.lending_type(arg) ⇒ Object
35 36 37 |
# File 'lib/world_bank/indicator.rb', line 35 def self.lending_type(arg) find('all').lending_type(arg) end |
.most_recent_values(arg) ⇒ Object
15 16 17 |
# File 'lib/world_bank/indicator.rb', line 15 def self.most_recent_values(arg) find('all').most_recent_values(arg) end |
.page(arg) ⇒ Object
19 20 21 |
# File 'lib/world_bank/indicator.rb', line 19 def self.page(arg) find('all').page(arg) end |
.per_page ⇒ Object
23 24 25 |
# File 'lib/world_bank/indicator.rb', line 23 def self.per_page find('all').per_page(arg) end |
.region(arg) ⇒ Object
39 40 41 |
# File 'lib/world_bank/indicator.rb', line 39 def self.region(arg) find('all').region(arg) end |