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



4
5
6
# File 'lib/everypolitician/popolo/post.rb', line 4

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

#organizationObject



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

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

#organization_idObject



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

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