Class: Pupa::Post
- Inherits:
-
Object
- Object
- Pupa::Post
- Includes:
- Concerns::Contactable, Concerns::Linkable, Concerns::Sourceable, Concerns::Timestamps, Model
- Defined in:
- lib/pupa/models/post.rb
Overview
A position that exists independent of the person holding it.
Instance Attribute Summary collapse
-
#area_id ⇒ Object
Returns the value of attribute area_id.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#label ⇒ Object
Returns the value of attribute label.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#other_label ⇒ Object
Returns the value of attribute other_label.
-
#role ⇒ Object
Returns the value of attribute role.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#fingerprint ⇒ Object
A post should have a unique label within an organization, through it may share a label with a historical post.
-
#to_s ⇒ String
Returns the post's label or role and organization ID.
Methods included from Concerns::Linkable
#add_link, #initialize, #links=
Methods included from Concerns::Contactable
#add_contact_detail, #contact_details=, #initialize
Methods included from Concerns::Sourceable
#add_source, #initialize, #sources=
Methods included from Model
#==, #[], #[]=, #_id=, #add_extra, #extras=, #foreign_properties, #initialize, #to_h, #validate!
Instance Attribute Details
#area_id ⇒ Object
Returns the value of attribute area_id.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def area_id @area_id end |
#end_date ⇒ Object
Returns the value of attribute end_date.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def end_date @end_date end |
#label ⇒ Object
Returns the value of attribute label.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def label @label end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def organization_id @organization_id end |
#other_label ⇒ Object
Returns the value of attribute other_label.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def other_label @other_label end |
#role ⇒ Object
Returns the value of attribute role.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def role @role end |
#start_date ⇒ Object
Returns the value of attribute start_date.
13 14 15 |
# File 'lib/pupa/models/post.rb', line 13 def start_date @start_date end |
Instance Method Details
#fingerprint ⇒ Object
A post should have a unique label within an organization, through it may share a label with a historical post.
27 28 29 |
# File 'lib/pupa/models/post.rb', line 27 def fingerprint super.slice(:label, :organization_id, :end_date) end |
#to_s ⇒ String
Returns the post's label or role and organization ID.
21 22 23 |
# File 'lib/pupa/models/post.rb', line 21 def to_s "#{label || role} in #{organization_id}" end |