Class: Everypolitician::Popolo::JSON

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(popolo) ⇒ JSON

Returns a new instance of JSON.



28
29
30
# File 'lib/everypolitician/popolo.rb', line 28

def initialize(popolo)
  @popolo = popolo
end

Instance Attribute Details

#popoloObject (readonly)

Returns the value of attribute popolo.



26
27
28
# File 'lib/everypolitician/popolo.rb', line 26

def popolo
  @popolo
end

Instance Method Details

#areasObject



40
41
42
# File 'lib/everypolitician/popolo.rb', line 40

def areas
  Areas.new(popolo[:areas])
end

#eventsObject



44
45
46
# File 'lib/everypolitician/popolo.rb', line 44

def events
  Events.new(popolo[:events])
end

#membershipsObject



52
53
54
# File 'lib/everypolitician/popolo.rb', line 52

def memberships
  Memberships.new(popolo[:memberships])
end

#organizationsObject



36
37
38
# File 'lib/everypolitician/popolo.rb', line 36

def organizations
  Organizations.new(popolo[:organizations])
end

#personsObject



32
33
34
# File 'lib/everypolitician/popolo.rb', line 32

def persons
  People.new(popolo[:persons])
end

#postsObject



48
49
50
# File 'lib/everypolitician/popolo.rb', line 48

def posts
  Posts.new(popolo[:posts])
end