Class: Twfy::MP

Inherits:
DataElement show all
Defined in:
lib/twfy/mp.rb

Instance Attribute Summary

Attributes inherited from DataElement

#client

Instance Method Summary collapse

Methods inherited from DataElement

convert, #convert, convert_to_date, #initialize, #update_attributes, #with

Constructor Details

This class inherits a constructor from Twfy::DataElement

Instance Method Details

#comments(params = {}) ⇒ Object



32
33
34
35
# File 'lib/twfy/mp.rb', line 32

def comments(params={})
  @comments ||= {}
  @comments[params] ||= @client.comments(params.merge(pid: @person_id))
end

#debates(params = {}) ⇒ Object



27
28
29
30
# File 'lib/twfy/mp.rb', line 27

def debates(params={})
  @debates ||= {}
  @debates[params] ||= @client.debates(params.merge(person: @person_id, type: 'commons'))
end

#in_office?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/twfy/mp.rb', line 19

def in_office?
  @left_reason == 'still_in_office'
end

#infoObject



23
24
25
# File 'lib/twfy/mp.rb', line 23

def info
  @info ||= @client.mp_info(id: @person_id)
end