Class: ONIX::TitleDetail

Inherits:
SubsetDSL show all
Defined in:
lib/onix/title_detail.rb

Instance Attribute Summary

Attributes included from Attributes

#attributes

Low level collapse

Shortcuts collapse

Instance Method Summary collapse

Methods inherited from SubsetDSL

element, elements, #get_class, get_class, inherited, #initialize, n, #parse, ref_to_short, register_elements, register_scopes, #register_subset_array, registered_elements, #registered_elements, registered_scopes, scope, short_to_ref

Methods inherited from Subset

parse, #parse, #tag_match, #unsupported

Methods included from Attributes

attribute_class, #parse_attributes, #serialized_attributes

Constructor Details

This class inherits a constructor from ONIX::SubsetDSL

Instance Method Details

#titleString

:category: High level flatten title string

Returns:

  • (String)


14
15
16
17
18
19
20
21
# File 'lib/onix/title_detail.rb', line 14

def title
  return title_statement if title_statement

  title_element = @title_elements.product_level #select { |te| te.level.human=~/Product/ }
  if title_element.size > 0
    title_element.first.title
  end
end

#title_elementsArray<TitleElement>

Returns:



6
# File 'lib/onix/title_detail.rb', line 6

elements "TitleElement", :subset, :cardinality => 1..n

#title_statementString

Returns:

  • (String)


7
# File 'lib/onix/title_detail.rb', line 7

element "TitleStatement", :text, :cardinality => 0..1

#title_typeTitleType

Returns:



5
# File 'lib/onix/title_detail.rb', line 5

element "TitleType", :subset, :shortcut => :type, :cardinality => 1

#typeTitleType

shortcut for #title_type

Returns:



5
# File 'lib/onix/title_detail.rb', line 5

element "TitleType", :subset, :shortcut => :type, :cardinality => 1