class Elibri::ONIX::Release_3_0::Extent

Constants

ATTRIBUTES

from ONIX documentation: covers product extents, in terms of pages, running times, file sizes etc, as may be appropriate to each media type. For products whose content is primarily readable text, it also covers illustrations and other kinds of ancillary matter such as the inclusion of a bibliography or index.

RELATIONS

Attributes

to_xml[RW]
type[RW]
unit[RW]
value[RW]

Public Class Methods

new(data) click to toggle source
# File lib/elibri_onix/onix_3_0/extent.rb, line 23
def initialize(data)
  @to_xml = data.to_s
  @type = data.css('ExtentType').try(:text).try(:strip)
  @value = data.css('ExtentValue').try(:text).try(:strip).try(:to_i)
  @unit = data.css('ExtentUnit').try(:text).try(:strip)
end

Public Instance Methods

inspect_include_fields() click to toggle source
# File lib/elibri_onix/onix_3_0/extent.rb, line 38
def inspect_include_fields
  [:type_name, :unit_name]
end
type_name() click to toggle source
# File lib/elibri_onix/onix_3_0/extent.rb, line 30
def type_name
  Elibri::ONIX::Dict::Release_3_0::ExtentType.find_by_onix_code(@type).try(:const_name).try(:downcase)
end
unit_name() click to toggle source
# File lib/elibri_onix/onix_3_0/extent.rb, line 34
def unit_name
  Elibri::ONIX::Dict::Release_3_0::ExtentUnit.find_by_onix_code(@unit).try(:const_name).try(:downcase)
end