Class: Arclight::Parent

Inherits:
Object
  • Object
show all
Defined in:
app/models/arclight/parent.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, label:, eadid:, level:) ⇒ Parent

Returns a new instance of Parent.



9
10
11
12
13
14
# File 'app/models/arclight/parent.rb', line 9

def initialize(id:, label:, eadid:, level:)
  @id = id
  @label = label
  @eadid = eadid
  @level = level
end

Instance Attribute Details

#eadidObject (readonly)

Returns the value of attribute eadid.



8
9
10
# File 'app/models/arclight/parent.rb', line 8

def eadid
  @eadid
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'app/models/arclight/parent.rb', line 8

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'app/models/arclight/parent.rb', line 8

def label
  @label
end

#levelObject (readonly)

Returns the value of attribute level.



8
9
10
# File 'app/models/arclight/parent.rb', line 8

def level
  @level
end

Instance Method Details

#global_idString

Concatenates the eadid and the id, to return an “id” in the context of Blacklight and Solr

Returns:

  • (String)


20
21
22
23
24
# File 'app/models/arclight/parent.rb', line 20

def global_id
  return id if eadid == id

  "#{eadid}#{id}"
end