Class: Locabulary::Items::AdministrativeUnit

Inherits:
Base
  • Object
show all
Defined in:
lib/locabulary/items/administrative_unit.rb

Overview

Responsible for exposing the data structure logic of the Administrative Units

See Also:

  • /data/administrative_units./data/administrative_units.json

Since:

  • 0.5.0

Constant Summary collapse

NON_DEPARTMENTAL_SLUG =

Since:

  • 0.5.0

"Non-Departmental".freeze
HUMAN_FRIENDLY_HIERARCHY_DELIMITER =

NOTE: The whitespace characters are “thin spaces”, U+200A

Since:

  • 0.5.0

' — '.freeze

Constants inherited from Base

Base::HIERARCHY_DELIMITER

Instance Attribute Summary collapse

Attributes inherited from Base

#activated_on, #deactivated_on, #default_presentation_sequence, #deposit_label, #description, #predicate_name, #term_label, #term_uri

Instance Method Summary collapse

Methods inherited from Base

#<=>, #add_child, #attribute_names, #children, hierarchy_delimiter, #hierarchy_facet_label, #initialize, #parent_slugs, #parent_term_label, #presentation_sequence, #root_slug, #selectable?, #slugs, #to_h, #to_persistence_format_for_fedora

Constructor Details

This class inherits a constructor from Locabulary::Items::Base

Instance Attribute Details

#affiliationObject

Since:

  • 0.5.0



23
24
25
# File 'lib/locabulary/items/administrative_unit.rb', line 23

def affiliation
  @affiliation
end

#classificationObject

Since:

  • 0.5.0



21
22
23
# File 'lib/locabulary/items/administrative_unit.rb', line 21

def classification
  @classification
end

#groupingObject

Since:

  • 0.5.0



22
23
24
# File 'lib/locabulary/items/administrative_unit.rb', line 22

def grouping
  @grouping
end

#homepageObject

String

What is the URL of the homepage. Please note the term_uri is reserved for something that is more resolvable by machines.

And while the homepage may look resolvable, it is not as meaningful for longterm preservation.

Since:

  • 0.5.0



20
21
22
# File 'lib/locabulary/items/administrative_unit.rb', line 20

def homepage
  @homepage
end

Instance Method Details

#selectable_labelObject

Since:

  • 0.5.0



34
35
36
37
38
39
40
# File 'lib/locabulary/items/administrative_unit.rb', line 34

def selectable_label
  if slugs[-1] == NON_DEPARTMENTAL_SLUG
    slugs[-2..-1].join(HUMAN_FRIENDLY_HIERARCHY_DELIMITER)
  else
    slugs[-1]
  end
end