Class: PDCMetadata::Title

Inherits:
Object
  • Object
show all
Defined in:
app/models/pdc_metadata/title.rb

Overview

value: “100 años de soledad” title_type: “TranslatedTitle”

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, title_type: nil) ⇒ Title

Returns a new instance of Title.



8
9
10
11
# File 'app/models/pdc_metadata/title.rb', line 8

def initialize(title:, title_type: nil)
  @title = title
  @title_type = title_type
end

Instance Attribute Details

#titleObject

Returns the value of attribute title.



7
8
9
# File 'app/models/pdc_metadata/title.rb', line 7

def title
  @title
end

#title_typeObject

Returns the value of attribute title_type.



7
8
9
# File 'app/models/pdc_metadata/title.rb', line 7

def title_type
  @title_type
end

Instance Method Details

#compare_valueObject



17
18
19
# File 'app/models/pdc_metadata/title.rb', line 17

def compare_value
  "#{title} (#{title_type})"
end

#main?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/pdc_metadata/title.rb', line 13

def main?
  @title_type.blank?
end