Class: Opennorth::Represent::Representative
- Inherits:
-
Fog::Model
- Object
- Fog::Model
- Opennorth::Represent::Representative
- Defined in:
- lib/opennorth/represent/models/representative.rb
Instance Method Summary collapse
- #honorific_prefix ⇒ Object
- #offices ⇒ Object
- #offices=(new_offices) ⇒ Object
- #preferred_language ⇒ Object
- #validate! ⇒ Object
Instance Method Details
#honorific_prefix ⇒ Object
29 30 31 |
# File 'lib/opennorth/represent/models/representative.rb', line 29 def honorific_prefix self.extra["honorific_prefix"] end |
#offices ⇒ Object
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_language ⇒ Object
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 |