Class: Everypolitician::Popolo::Post

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

Instance Attribute Summary

Attributes inherited from Entity

#document, #popolo

Instance Method Summary collapse

Methods inherited from Entity

#==, #[], classification, #id, #identifier, #identifiers, inherited, #initialize, #key?, subclasses, #wikidata

Constructor Details

This class inherits a constructor from Everypolitician::Popolo::Entity

Instance Method Details

#labelObject



9
10
11
# File 'lib/everypolitician/popolo/post.rb', line 9

def label
  document.fetch(:label, nil)
end

#organizationObject



17
18
19
# File 'lib/everypolitician/popolo/post.rb', line 17

def organization
  popolo.organizations.find_by(id: organization_id)
end

#organization_idObject



13
14
15
# File 'lib/everypolitician/popolo/post.rb', line 13

def organization_id
  document.fetch(:organization_id, nil)
end