Class: WorldbankAsDataframe::Indicator
- Inherits:
-
Object
- Object
- WorldbankAsDataframe::Indicator
- Extended by:
- Queriable
- Defined in:
- lib/worldbank_as_dataframe/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
Instance Method Summary collapse
-
#initialize(values = {}) ⇒ Indicator
constructor
A new instance of Indicator.
Methods included from Queriable
format, income_level, language, lending_type, most_recent_values, page, per_page, region
Constructor Details
#initialize(values = {}) ⇒ Indicator
Returns a new instance of Indicator.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 28 def initialize(values={}) @raw = values @id = values['id'] @name = values['name'] @source = WorldbankAsDataframe::Source.new(values['source']) @note = values['sourceNote'] @organization = values['sourceOrganization'] @topics = [] values['topics'].each do |topic| @topics << WorldbankAsDataframe::Topic.new(topic) end @type = 'indicator' end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def name @name end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def note @note end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def organization @organization end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def raw @raw end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def source @source end |
#topics ⇒ Object (readonly)
Returns the value of attribute topics.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def topics @topics end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 6 def type @type end |
Class Method Details
.all ⇒ Object
20 21 22 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 20 def self.all find('all') end |
.country ⇒ Object
8 9 10 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 8 def self.country find('all').country(arg) end |
.featured ⇒ Object
16 17 18 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 16 def self.featured find('all').featured_indicators end |
.fetch(arg) ⇒ Object
12 13 14 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 12 def self.fetch(arg) find(arg).fetch end |
.find(id) ⇒ Object
24 25 26 |
# File 'lib/worldbank_as_dataframe/indicator.rb', line 24 def self.find(id) WorldbankAsDataframe::ParamQuery.new('indicator', id, self) end |