Class: Arclight::LevelLabel

Inherits:
Object
  • Object
show all
Defined in:
lib/arclight/level_label.rb

Overview

A utility class to return a human-readable label for an EAD @level code. Can use the value from @otherlevel if provided. Examples from @level: recordgrp = “Record Group”

collection = "Collection"
subseries = "Subseries"
otherlevel = (text provided in @otherlevel)

Instance Method Summary collapse

Constructor Details

#initialize(level, other_level = nil) ⇒ LevelLabel

Returns a new instance of LevelLabel.

Parameters:

  • `level` (String)

    from the collection or component @level

  • `other_level` (String)

    from the collection or component @otherlevel



14
15
16
17
# File 'lib/arclight/level_label.rb', line 14

def initialize(level, other_level = nil)
  @level = level
  @other_level = other_level if other_level.present?
end

Instance Method Details

#to_sString

Returns the human-readable label.

Returns:

  • (String)

    the human-readable label



20
21
22
# File 'lib/arclight/level_label.rb', line 20

def to_s
  human_readable_level
end