Class: DS::Extractor::Name
- Defined in:
- lib/ds/extractor/name.rb
Instance Attribute Summary collapse
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#role ⇒ Object
Returns the value of attribute role.
-
#vernacular ⇒ Object
Returns the value of attribute vernacular.
Attributes inherited from BaseTerm
Instance Method Summary collapse
-
#initialize(as_recorded:, role: nil, vernacular: nil, ref: nil) ⇒ Object
constructor
Initializes a Name object with the provided parameters.
-
#to_a ⇒ Array
Returns an array representation of the name.
-
#to_h ⇒ Hash
Returns a hash representation of the name object.
Methods inherited from BaseTerm
Constructor Details
#initialize(as_recorded:, role: nil, vernacular: nil, ref: nil) ⇒ Object
Initializes a Name object with the provided parameters.
Parameters:
18 19 20 21 22 23 |
# File 'lib/ds/extractor/name.rb', line 18 def initialize as_recorded:, role: nil, vernacular: nil, ref: nil @role = role @vernacular = vernacular @ref = ref super(as_recorded: as_recorded) end |
Instance Attribute Details
#ref ⇒ Object
Returns the value of attribute ref.
8 9 10 |
# File 'lib/ds/extractor/name.rb', line 8 def ref @ref end |
#role ⇒ Object
Returns the value of attribute role.
6 7 8 |
# File 'lib/ds/extractor/name.rb', line 6 def role @role end |
#vernacular ⇒ Object
Returns the value of attribute vernacular.
7 8 9 |
# File 'lib/ds/extractor/name.rb', line 7 def vernacular @vernacular end |
Instance Method Details
#to_a ⇒ Array
Returns an array representation of the name.
[as_recorded, role, vernacular, ref]
30 31 32 |
# File 'lib/ds/extractor/name.rb', line 30 def to_a [as_recorded, role, vernacular, ref] end |
#to_h ⇒ Hash
Returns a hash representation of the name object.
Keys are :as_recorded, :role, :name_agr, :source_authority_uri
39 40 41 42 43 44 45 46 47 |
# File 'lib/ds/extractor/name.rb', line 39 def to_h { name_as_recorded: as_recorded, as_recorded: as_recorded, role: role, name_agr: vernacular, source_authority_uri: ref } end |