Class: Pupa::Organization
- Inherits:
-
Object
- Object
- Pupa::Organization
- Includes:
- Concerns::Contactable, Concerns::Identifiable, Concerns::Linkable, Concerns::Nameable, Concerns::Sourceable, Concerns::Timestamps, Model
- Defined in:
- lib/pupa/models/organization.rb
Overview
A group with a common purpose or reason for existence that goes beyond the set of people belonging to it.
Instance Attribute Summary collapse
-
#area_id ⇒ Object
Returns the value of attribute area_id.
-
#classification ⇒ Object
Returns the value of attribute classification.
-
#dissolution_date ⇒ Object
Returns the value of attribute dissolution_date.
-
#founding_date ⇒ Object
Returns the value of attribute founding_date.
-
#image ⇒ Object
Returns the value of attribute image.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
Instance Method Summary collapse
- #fingerprint ⇒ Object
-
#to_s ⇒ String
Returns the name of the organization.
Methods included from Concerns::Linkable
#add_link, #initialize, #links=
Methods included from Concerns::Contactable
#add_contact_detail, #contact_details=, #initialize
Methods included from Concerns::Identifiable
#add_identifier, #identifiers=, #initialize
Methods included from Concerns::Nameable
#add_name, #initialize, #other_names=
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.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def area_id @area_id end |
#classification ⇒ Object
Returns the value of attribute classification.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def classification @classification end |
#dissolution_date ⇒ Object
Returns the value of attribute dissolution_date.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def dissolution_date @dissolution_date end |
#founding_date ⇒ Object
Returns the value of attribute founding_date.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def founding_date @founding_date end |
#image ⇒ Object
Returns the value of attribute image.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def image @image end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def parent @parent end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
16 17 18 |
# File 'lib/pupa/models/organization.rb', line 16 def parent_id @parent_id end |
Instance Method Details
#fingerprint ⇒ Object
Parentless organizations in different jurisdictions can have the
same name. Add a jurisdiction
property?
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/pupa/models/organization.rb', line 32 def fingerprint hash = super.slice(:classification, :parent_id) if name { '$or' => [ hash.merge('name' => name), hash.merge('other_names.name' => name), ], } else hash end end |
#to_s ⇒ String
Returns the name of the organization.
26 27 28 |
# File 'lib/pupa/models/organization.rb', line 26 def to_s name end |