Class: Everypolitician::Legislature

Inherits:
Entity
  • Object
show all
Defined in:
lib/everypolitician.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#initialize

Constructor Details

This class inherits a constructor from Everypolitician::Entity

Class Method Details

.find(country_slug, legislature_slug) ⇒ Object



62
63
64
# File 'lib/everypolitician.rb', line 62

def self.find(country_slug, legislature_slug)
  Country.find(country_slug).legislature(legislature_slug)
end

Instance Method Details

#popoloObject



66
67
68
# File 'lib/everypolitician.rb', line 66

def popolo
  @popolo ||= Everypolitician::Popolo.parse(open(popolo_url).read)
end

#process_data(data) ⇒ Object



70
71
72
73
74
# File 'lib/everypolitician.rb', line 70

def process_data(data)
  data[:popolo_url] = 'https://raw.githubusercontent.com/everypolitician' \
    "/everypolitician-data/master/#{data.delete(:popolo)}"
  data
end