Class: Opennorth::Represent::Representative

Inherits:
Fog::Model
  • Object
show all
Defined in:
lib/opennorth/represent/models/representative.rb

Instance Method Summary collapse

Instance Method Details

#honorific_prefixObject



29
30
31
# File 'lib/opennorth/represent/models/representative.rb', line 29

def honorific_prefix
  self.extra["honorific_prefix"]
end

#officesObject



20
21
22
# File 'lib/opennorth/represent/models/representative.rb', line 20

def offices
  attributes.fetch(:offices) { attributes[:offices] = Opennorth::Represent::Offices.new(service: service).load([]) }
end

#offices=(new_offices) ⇒ Object



24
25
26
27
# File 'lib/opennorth/represent/models/representative.rb', line 24

def offices=(new_offices)
  self.offices.clear
  self.offices.load(new_offices)
end

#preferred_languageObject



33
34
35
# File 'lib/opennorth/represent/models/representative.rb', line 33

def preferred_language
  self.extra["preferred_language"]
end

#validate!Object



16
17
18
# File 'lib/opennorth/represent/models/representative.rb', line 16

def validate!
  requires :name, :district_name, :elected_office, :source_url
end