Class: PDCMetadata::Title
- Inherits:
-
Object
- Object
- PDCMetadata::Title
- Defined in:
- app/models/pdc_metadata/title.rb
Overview
value: “100 años de soledad” title_type: “TranslatedTitle”
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_type ⇒ Object
Returns the value of attribute title_type.
Instance Method Summary collapse
- #compare_value ⇒ Object
-
#initialize(title:, title_type: nil) ⇒ Title
constructor
A new instance of Title.
- #main? ⇒ Boolean
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
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'app/models/pdc_metadata/title.rb', line 7 def title @title end |
#title_type ⇒ Object
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_value ⇒ Object
17 18 19 |
# File 'app/models/pdc_metadata/title.rb', line 17 def compare_value "#{title} (#{title_type})" end |
#main? ⇒ Boolean
13 14 15 |
# File 'app/models/pdc_metadata/title.rb', line 13 def main? @title_type.blank? end |