Class: WorldBank::Indicator

Inherits:
Object
  • Object
show all
Defined in:
lib/world_bank/indicator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def name
  @name
end

#noteObject (readonly)

Returns the value of attribute note.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def note
  @note
end

#organizationObject (readonly)

Returns the value of attribute organization.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def organization
  @organization
end

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def raw
  @raw
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def source
  @source
end

#topicsObject (readonly)

Returns the value of attribute topics.



5
6
7
# File 'lib/world_bank/indicator.rb', line 5

def topics
  @topics
end

#typeObject (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

.allObject



55
56
57
# File 'lib/world_bank/indicator.rb', line 55

def self.all
  find('all')
end

.countryObject



43
44
45
# File 'lib/world_bank/indicator.rb', line 43

def self.country
  find('all').country(arg)
end


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_pageObject



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