Class: ONIX::Product
- Extended by:
- Forwardable
- Includes:
- IdentifiersMethods::Ean, IdentifiersMethods::Isbn, IdentifiersMethods::ProprietaryId, ProductSuppliesMethods
- Defined in:
- lib/onix/product.rb
Instance Attribute Summary collapse
-
#default_currency_code ⇒ Object
default code from ONIXMessage.
-
#default_language_of_text ⇒ Object
default LanguageCode from ONIXMessage.
Attributes included from Attributes
Shortcuts collapse
-
#identifiers ⇒ Array<ProductIdentifier>
shortcut for #product_identifiers.
- #publishers ⇒ Array<Publisher>
High level collapse
-
#audio? ⇒ Boolean
Forwarded to DescriptiveDetail#audio?.
-
#audio_format ⇒ String
Forwarded to DescriptiveDetail#audio_format.
-
#audio_formats ⇒ Array<ProductFormDetail>
Forwarded to DescriptiveDetail#audio_formats.
-
#available? ⇒ Boolean
is product available ?.
-
#available_for_country?(country) ⇒ Boolean
is product available for given
country
?. -
#available_product_supplies ⇒ Array<ProductSupply>
available product supplies.
-
#bisac_categories ⇒ Object
deprecated.
-
#bisac_categories_codes ⇒ Array<String>
Forwarded to DescriptiveDetail#bisac_categories_codes.
-
#bundle? ⇒ Boolean
Forwarded to DescriptiveDetail#bundle?.
-
#clil_categories ⇒ Object
deprecated.
-
#clil_categories_codes ⇒ Array<String>
Forwarded to DescriptiveDetail#clil_categories_codes.
- #collateral_detail ⇒ CollateralDetail
-
#contributors ⇒ Array<Contributor>
Forwarded to DescriptiveDetail#contributors.
-
#countries_rights ⇒ Array<String>
product countries rights string array.
-
#delete? ⇒ Boolean
is product a deletion notification ?.
-
#description ⇒ String
Forwarded to CollateralDetail#description.
- #descriptive_detail ⇒ DescriptiveDetail
-
#digital? ⇒ Boolean
Forwarded to DescriptiveDetail#digital?.
-
#distributor ⇒ String
product distributor name.
-
#distributor_gln ⇒ String
product distributor GLN string.
-
#distributor_name ⇒ String
product distributor name string.
-
#distributors ⇒ Array<String>
product distributors names.
-
#drmized? ⇒ Boolean
Forwarded to DescriptiveDetail#drmized?.
-
#edition_number ⇒ Integer
Forwarded to DescriptiveDetail#edition_number.
-
#embargo_date ⇒ Date
Forwarded to ONIX::PublishingDetail#embargo_date.
-
#epub_sample_last_updated ⇒ Date
Forwarded to CollateralDetail#epub_sample_last_updated.
-
#epub_sample_mimetype ⇒ String
Forwarded to CollateralDetail#epub_sample_mimetype.
-
#epub_sample_url ⇒ String
Forwarded to CollateralDetail#epub_sample_url.
-
#excerpts ⇒ Object
all excerpts.
-
#file_description ⇒ String
Forwarded to DescriptiveDetail#file_description.
-
#file_format ⇒ String
Forwarded to DescriptiveDetail#file_format.
-
#file_mimetype ⇒ String
Forwarded to DescriptiveDetail#file_mimetype.
-
#filesize ⇒ Integer
Forwarded to DescriptiveDetail#filesize.
-
#form_details ⇒ Array<ProductFormDetail>
Forwarded to DescriptiveDetail#form_details.
-
#frontcover_last_updated ⇒ Object
Forwarded to CollateralDetail#frontcover_last_updated.
-
#frontcover_mimetype ⇒ Object
Forwarded to CollateralDetail#frontcover_mimetype.
-
#frontcover_url ⇒ String
Forwarded to CollateralDetail#frontcover_url.
-
#illustrations ⇒ Object
all images.
-
#imprint ⇒ Imprint
Forwarded to ONIX::PublishingDetail#imprint.
-
#imprint_gln ⇒ String
imprint GLN string.
-
#imprint_name ⇒ String
imprint name string.
-
#keywords ⇒ Array<String>
Forwarded to DescriptiveDetail#keywords.
-
#language_code_of_text ⇒ String
product language code string of text (eg: fre).
-
#language_name_of_text ⇒ String
product language name string of text (eg: French).
-
#language_of_text ⇒ String
product LanguageCode of text.
-
#onix_outlets_values ⇒ Array<String>
List of ONIX outlets values.
-
#pages ⇒ Integer
Forwarded to DescriptiveDetail#pages.
-
#paper_linking ⇒ RelatedProduct
DEPRECATED see print_product instead.
-
#part_of_product ⇒ RelatedProduct
first part RelatedProduct.
-
#parts ⇒ Array<ProductPart>
Forwarded to DescriptiveDetail#parts.
-
#preorder_embargo_date ⇒ Date
Forwarded to ONIX::PublishingDetail#preorder_embargo_date.
-
#price_to_be_announced? ⇒ Boolean
is product price to be announced ?.
-
#print_product ⇒ RelatedProduct
first paper linking RelatedProduct.
-
#protection_type ⇒ String
Forwarded to DescriptiveDetail#protection_type.
-
#protections ⇒ Array<String>
Forwarded to DescriptiveDetail#protections.
-
#public_announcement_date ⇒ Date
Forwarded to ONIX::PublishingDetail#public_announcement_date.
-
#publication_date ⇒ Date
Forwarded to ONIX::PublishingDetail#publication_date.
-
#publisher ⇒ Publisher
Forwarded to ONIX::PublishingDetail#publisher.
-
#publisher_collection_title ⇒ String
Forwarded to DescriptiveDetail#publisher_collection_title.
-
#publisher_gln ⇒ String
publisher GLN string, nil if multiple publishers are found.
-
#publisher_name ⇒ String
publisher name string, if multiple publishers are found, then they are concatenated with “ / ”.
- #publishing_detail ⇒ PublishingDetail
-
#raw_description ⇒ String
raw book description string without HTML.
-
#raw_file_description ⇒ String
raw file description string without HTML.
-
#reflowable? ⇒ Boolean
Forwarded to DescriptiveDetail#reflowable?.
-
#related ⇒ Array
return every related subset.
-
#sales_restriction ⇒ SalesRestriction
Forwarded to ONIX::PublishingDetail#sales_restriction.
-
#sold_separately? ⇒ Boolean
product can be sold separately ?.
-
#streaming? ⇒ Boolean
Forwarded to DescriptiveDetail#streaming?.
-
#subjects ⇒ Array<Subject>
Forwarded to DescriptiveDetail#subjects.
-
#subtitle ⇒ String
Forwarded to DescriptiveDetail#subtitle.
- #title ⇒ Object
Low level collapse
- #barcodes ⇒ Array<Barcode>
- #content_detail ⇒ ContentDetail
- #deletion_texts ⇒ Array<String>
- #notification_type ⇒ NotificationType
- #product_identifiers ⇒ Array<ProductIdentifier>
- #product_supplies ⇒ Array<ProductSupply>
- #record_reference ⇒ String
- #record_source_identifiers ⇒ Array<RecordSourceIdentifier>
- #record_source_name ⇒ String
- #record_source_type ⇒ RecordSourceType
- #related_material ⇒ RelatedMaterial
Instance Method Summary collapse
Methods included from ProductSuppliesMethods
#add_ending_period, #add_missing_periods, #add_starting_period, #at_time_price_amount_for, #current_price_amount_for, #prices_with_periods, #supplies, #supplies_excluding_tax, #supplies_for_country, #supplies_including_tax, #supplies_with_default_tax
Methods included from IdentifiersMethods::ProprietaryId
Methods included from IdentifiersMethods::Isbn
Methods included from IdentifiersMethods::Ean
Methods inherited from SubsetDSL
element, elements, #get_class, get_class, inherited, #initialize, n, 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, #tag_match, #unsupported
Methods included from Attributes
attribute_class, #parse_attributes, #serialized_attributes
Constructor Details
This class inherits a constructor from ONIX::SubsetDSL
Instance Attribute Details
#default_currency_code ⇒ Object
default code from ONIXMessage
48 49 50 |
# File 'lib/onix/product.rb', line 48 def default_currency_code @default_currency_code end |
#default_language_of_text ⇒ Object
default LanguageCode from ONIXMessage
46 47 48 |
# File 'lib/onix/product.rb', line 46 def default_language_of_text @default_language_of_text end |
Instance Method Details
#audio? ⇒ Boolean
Forwarded to DescriptiveDetail#audio?
74 |
# File 'lib/onix/product.rb', line 74 def_delegator :descriptive_detail, :audio? |
#audio_format ⇒ String
Forwarded to DescriptiveDetail#audio_format
80 |
# File 'lib/onix/product.rb', line 80 def_delegator :descriptive_detail, :audio_format |
#audio_formats ⇒ Array<ProductFormDetail>
Forwarded to DescriptiveDetail#audio_formats
79 |
# File 'lib/onix/product.rb', line 79 def_delegator :descriptive_detail, :audio_formats |
#available? ⇒ Boolean
is product available ?
324 325 326 |
# File 'lib/onix/product.rb', line 324 def available? self.available_product_supplies.length > 0 and not self.delete? end |
#available_for_country?(country) ⇒ Boolean
is product available for given country
?
330 331 332 |
# File 'lib/onix/product.rb', line 330 def available_for_country?(country) self.supplies_for_country(country).select { |s| s[:available] }.length > 0 and self.available? end |
#available_product_supplies ⇒ Array<ProductSupply>
available product supplies
318 319 320 |
# File 'lib/onix/product.rb', line 318 def available_product_supplies @product_supplies.select { |product_supply| product_supply.available? } end |
#barcodes ⇒ Array<Barcode>
33 |
# File 'lib/onix/product.rb', line 33 elements "Barcode", :subset, :cardinality => 0..n |
#bisac_categories ⇒ Object
deprecated
65 |
# File 'lib/onix/product.rb', line 65 def_delegator :descriptive_detail, :bisac_categories |
#bisac_categories_codes ⇒ Array<String>
Forwarded to DescriptiveDetail#bisac_categories_codes
67 |
# File 'lib/onix/product.rb', line 67 def_delegator :descriptive_detail, :bisac_categories_codes |
#bundle? ⇒ Boolean
Forwarded to DescriptiveDetail#bundle?
76 |
# File 'lib/onix/product.rb', line 76 def_delegator :descriptive_detail, :bundle? |
#clil_categories ⇒ Object
deprecated
66 |
# File 'lib/onix/product.rb', line 66 def_delegator :descriptive_detail, :clil_categories |
#clil_categories_codes ⇒ Array<String>
Forwarded to DescriptiveDetail#clil_categories_codes
68 |
# File 'lib/onix/product.rb', line 68 def_delegator :descriptive_detail, :clil_categories_codes |
#collateral_detail ⇒ CollateralDetail
107 |
# File 'lib/onix/product.rb', line 107 element "CollateralDetail", :subset, :cardinality => 0..1 |
#content_detail ⇒ ContentDetail
40 |
# File 'lib/onix/product.rb', line 40 element "ContentDetail", :subset, :cardinality => 0..1 |
#contributors ⇒ Array<Contributor>
Forwarded to DescriptiveDetail#contributors
88 |
# File 'lib/onix/product.rb', line 88 def_delegator :descriptive_detail, :contributors |
#countries_rights ⇒ Array<String>
product countries rights string array
269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/onix/product.rb', line 269 def countries_rights countries = [] if @publishing_detail countries += @publishing_detail.sales_rights.map { |sale_right| sale_right.territory.countries }.flatten.uniq end if @product_supplies countries += @product_supplies.map { |product_supply| product_supply.markets.map { |market| market.territory.countries }.flatten }.flatten.uniq end countries.uniq end |
#delete? ⇒ Boolean
is product a deletion notification ?
345 346 347 |
# File 'lib/onix/product.rb', line 345 def delete? self.notification_type.human == "Delete" end |
#deletion_texts ⇒ Array<String>
28 |
# File 'lib/onix/product.rb', line 28 elements "DeletionText", :text, :cardinality => 0..n |
#description ⇒ String
Forwarded to CollateralDetail#description
90 |
# File 'lib/onix/product.rb', line 90 def_delegator :collateral_detail, :description |
#descriptive_detail ⇒ DescriptiveDetail
112 |
# File 'lib/onix/product.rb', line 112 element "DescriptiveDetail", :subset, :cardinality => 0..1 |
#digital? ⇒ Boolean
Forwarded to DescriptiveDetail#digital?
73 |
# File 'lib/onix/product.rb', line 73 def_delegator :descriptive_detail, :digital? |
#distributor ⇒ String
product distributor name
207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/onix/product.rb', line 207 def distributor if self.distributors.length > 0 if self.distributors.length == 1 self.distributors.first else raise ExpectsOneButHasSeveral, self.distributors.map(&:name) end else nil end end |
#distributor_gln ⇒ String
product distributor GLN string
229 230 231 232 233 |
# File 'lib/onix/product.rb', line 229 def distributor_gln if self.distributor self.distributor.gln end end |
#distributor_name ⇒ String
product distributor name string
221 222 223 224 225 |
# File 'lib/onix/product.rb', line 221 def distributor_name if self.distributor self.distributor.name end end |
#distributors ⇒ Array<String>
product distributors names
201 202 203 |
# File 'lib/onix/product.rb', line 201 def distributors @product_supplies.map { |ps| ps.distributors }.flatten.uniq { |d| d.name } end |
#drmized? ⇒ Boolean
Forwarded to DescriptiveDetail#drmized?
72 |
# File 'lib/onix/product.rb', line 72 def_delegator :descriptive_detail, :drmized? |
#edition_number ⇒ Integer
Forwarded to DescriptiveDetail#edition_number
63 |
# File 'lib/onix/product.rb', line 63 def_delegator :descriptive_detail, :edition_number |
#embargo_date ⇒ Date
Forwarded to ONIX::PublishingDetail#embargo_date
99 |
# File 'lib/onix/product.rb', line 99 def_delegator :publishing_detail, :embargo_date |
#epub_sample_last_updated ⇒ Date
Forwarded to CollateralDetail#epub_sample_last_updated
95 |
# File 'lib/onix/product.rb', line 95 def_delegator :collateral_detail, :epub_sample_last_updated |
#epub_sample_mimetype ⇒ String
Forwarded to CollateralDetail#epub_sample_mimetype
96 |
# File 'lib/onix/product.rb', line 96 def_delegator :collateral_detail, :epub_sample_mimetype |
#epub_sample_url ⇒ String
Forwarded to CollateralDetail#epub_sample_url
94 |
# File 'lib/onix/product.rb', line 94 def_delegator :collateral_detail, :epub_sample_url |
#excerpts ⇒ Object
all excerpts
302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/onix/product.rb', line 302 def excerpts return [] unless @collateral_detail && @collateral_detail.supporting_resources @collateral_detail.supporting_resources.sample_content.human_code_match(:resource_mode, ["Text", "MultiMode"]).map do |resource| { :url => resource.versions.last.links.first.strip, :form => resource.versions.last.form.human, :md5 => resource.versions.last.md5_hash, :format_code => resource.versions.last.file_format, :updated_at => resource.versions.last.last_updated_utc } end end |
#file_description ⇒ String
Forwarded to DescriptiveDetail#file_description
83 |
# File 'lib/onix/product.rb', line 83 def_delegator :descriptive_detail, :file_description |
#file_format ⇒ String
Forwarded to DescriptiveDetail#file_format
81 |
# File 'lib/onix/product.rb', line 81 def_delegator :descriptive_detail, :file_format |
#file_mimetype ⇒ String
Forwarded to DescriptiveDetail#file_mimetype
82 |
# File 'lib/onix/product.rb', line 82 def_delegator :descriptive_detail, :file_mimetype |
#filesize ⇒ Integer
Forwarded to DescriptiveDetail#filesize
78 |
# File 'lib/onix/product.rb', line 78 def_delegator :descriptive_detail, :filesize |
#form_details ⇒ Array<ProductFormDetail>
Forwarded to DescriptiveDetail#form_details
87 |
# File 'lib/onix/product.rb', line 87 def_delegator :descriptive_detail, :form_details |
#frontcover_last_updated ⇒ Object
Forwarded to CollateralDetail#frontcover_last_updated
92 |
# File 'lib/onix/product.rb', line 92 def_delegator :collateral_detail, :frontcover_last_updated |
#frontcover_mimetype ⇒ Object
Forwarded to CollateralDetail#frontcover_mimetype
93 |
# File 'lib/onix/product.rb', line 93 def_delegator :collateral_detail, :frontcover_mimetype |
#frontcover_url ⇒ String
Forwarded to CollateralDetail#frontcover_url
91 |
# File 'lib/onix/product.rb', line 91 def_delegator :collateral_detail, :frontcover_url |
#identifiers ⇒ Array<ProductIdentifier>
shortcut for #product_identifiers
32 |
# File 'lib/onix/product.rb', line 32 elements "ProductIdentifier", :subset, :shortcut => :identifiers, :cardinality => 0..n |
#illustrations ⇒ Object
all images
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/onix/product.rb', line 285 def illustrations return [] unless @collateral_detail && @collateral_detail.supporting_resources @collateral_detail.supporting_resources.image.map do |image_resource| { :url => image_resource.versions.last.links.first.strip, :type => image_resource.type.human, :width => image_resource.versions.last.image_width, :height => image_resource.versions.last.image_height, :caption => image_resource.caption, :format_code => image_resource.versions.last.file_format, :updated_at => image_resource.versions.last.last_updated_utc } end end |
#imprint ⇒ Imprint
Forwarded to ONIX::PublishingDetail#imprint
103 |
# File 'lib/onix/product.rb', line 103 def_delegator :publishing_detail, :imprint |
#imprint_gln ⇒ String
imprint GLN string
193 194 195 196 197 |
# File 'lib/onix/product.rb', line 193 def imprint_gln if self.imprint self.imprint.gln end end |
#imprint_name ⇒ String
imprint name string
185 186 187 188 189 |
# File 'lib/onix/product.rb', line 185 def imprint_name if self.imprint self.imprint.name end end |
#keywords ⇒ Array<String>
Forwarded to DescriptiveDetail#keywords
69 |
# File 'lib/onix/product.rb', line 69 def_delegator :descriptive_detail, :keywords |
#language_code_of_text ⇒ String
product language code string of text (eg: fre)
129 130 131 132 133 |
# File 'lib/onix/product.rb', line 129 def language_code_of_text if self.language_of_text self.language_of_text.code end end |
#language_name_of_text ⇒ String
product language name string of text (eg: French)
137 138 139 140 141 |
# File 'lib/onix/product.rb', line 137 def language_name_of_text if self.language_of_text self.language_of_text.human end end |
#language_of_text ⇒ String
product LanguageCode of text
123 124 125 |
# File 'lib/onix/product.rb', line 123 def language_of_text @descriptive_detail.language_of_text || @default_language_of_text end |
#notification_type ⇒ NotificationType
27 |
# File 'lib/onix/product.rb', line 27 element "NotificationType", :subset, :cardinality => 1 |
#onix_outlets_values ⇒ Array<String>
List of ONIX outlets values
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/onix/product.rb', line 351 def onix_outlets_values if @publishing_detail @publishing_detail.sales_rights.map { |sales_right| sales_right.sales_restrictions.select { |sales_restriction| (!sales_restriction.start_date or sales_restriction.start_date <= Date.today) and (!sales_restriction.end_date or sales_restriction.end_date >= Date.today) }.map { |sale_right| sale_right.sales_outlets.select { |sale_outlet| sale_outlet.identifier and sale_outlet.identifier.type.human == "OnixRetailSalesOutletIdCode" }.map { |sale_outlet| sale_outlet.identifier.value } } }.flatten else [] end end |
#pages ⇒ Integer
Forwarded to DescriptiveDetail#pages
85 |
# File 'lib/onix/product.rb', line 85 def_delegator :descriptive_detail, :pages |
#paper_linking ⇒ RelatedProduct
DEPRECATED see print_product instead
263 264 265 |
# File 'lib/onix/product.rb', line 263 def paper_linking self.print_product end |
#parse(n) ⇒ Object
371 372 373 374 375 376 |
# File 'lib/onix/product.rb', line 371 def parse(n) super parts.each do |part| part.part_of = self end end |
#part_of_product ⇒ RelatedProduct
first part RelatedProduct
247 248 249 250 251 |
# File 'lib/onix/product.rb', line 247 def part_of_product if @related_material @related_material.part_of_products.first end end |
#parts ⇒ Array<ProductPart>
Forwarded to DescriptiveDetail#parts
77 |
# File 'lib/onix/product.rb', line 77 def_delegator :descriptive_detail, :parts |
#preorder_embargo_date ⇒ Date
Forwarded to ONIX::PublishingDetail#preorder_embargo_date
100 |
# File 'lib/onix/product.rb', line 100 def_delegator :publishing_detail, :preorder_embargo_date |
#price_to_be_announced? ⇒ Boolean
is product price to be announced ?
336 337 338 339 340 341 |
# File 'lib/onix/product.rb', line 336 def price_to_be_announced? unless self.product_supplies.empty? || self.product_supplies.first.supply_details.empty? unpriced_item_type = self.product_supplies.first.supply_details.first.unpriced_item_type end unpriced_item_type ? unpriced_item_type.human == "PriceToBeAnnounced" : false end |
#print_product ⇒ RelatedProduct
first paper linking RelatedProduct
255 256 257 258 259 |
# File 'lib/onix/product.rb', line 255 def print_product if @related_material @related_material.print_products.first end end |
#product_identifiers ⇒ Array<ProductIdentifier>
32 |
# File 'lib/onix/product.rb', line 32 elements "ProductIdentifier", :subset, :shortcut => :identifiers, :cardinality => 0..n |
#product_supplies ⇒ Array<ProductSupply>
43 |
# File 'lib/onix/product.rb', line 43 elements "ProductSupply", :subset, :cardinality => 0..n |
#protection_type ⇒ String
Forwarded to DescriptiveDetail#protection_type
70 |
# File 'lib/onix/product.rb', line 70 def_delegator :descriptive_detail, :protection_type |
#protections ⇒ Array<String>
Forwarded to DescriptiveDetail#protections
71 |
# File 'lib/onix/product.rb', line 71 def_delegator :descriptive_detail, :protections |
#public_announcement_date ⇒ Date
Forwarded to ONIX::PublishingDetail#public_announcement_date
101 |
# File 'lib/onix/product.rb', line 101 def_delegator :publishing_detail, :public_announcement_date |
#publication_date ⇒ Date
Forwarded to ONIX::PublishingDetail#publication_date
98 |
# File 'lib/onix/product.rb', line 98 def_delegator :publishing_detail, :publication_date |
#publisher ⇒ Publisher
Forwarded to ONIX::PublishingDetail#publisher
104 |
# File 'lib/onix/product.rb', line 104 def_delegator :publishing_detail, :publisher |
#publisher_collection_title ⇒ String
Forwarded to DescriptiveDetail#publisher_collection_title
64 |
# File 'lib/onix/product.rb', line 64 def_delegator :descriptive_detail, :publisher_collection_title |
#publisher_gln ⇒ String
publisher GLN string, nil if multiple publishers are found
177 178 179 180 181 |
# File 'lib/onix/product.rb', line 177 def publisher_gln if self.publishers.length == 1 self.publisher.gln end end |
#publisher_name ⇒ String
publisher name string, if multiple publishers are found, then they are concatenated with “ / ”
169 170 171 172 173 |
# File 'lib/onix/product.rb', line 169 def publisher_name if self.publishers.length > 0 self.publishers.map { |p| p.name }.join(" / ") end end |
#publishers ⇒ Array<Publisher>
53 54 55 |
# File 'lib/onix/product.rb', line 53 def publishers @publishing_detail ? @publishing_detail.publishers : [] end |
#publishing_detail ⇒ PublishingDetail
117 |
# File 'lib/onix/product.rb', line 117 element "PublishingDetail", :subset, :cardinality => 0..1 |
#raw_description ⇒ String
raw book description string without HTML
161 162 163 164 165 |
# File 'lib/onix/product.rb', line 161 def raw_description if self.description Helper.strip_html(self.description).gsub(/\s+/, " ").strip end end |
#raw_file_description ⇒ String
raw file description string without HTML
153 154 155 156 157 |
# File 'lib/onix/product.rb', line 153 def raw_file_description if @descriptive_detail.file_description Helper.strip_html(@descriptive_detail.file_description).gsub(/\s+/, " ").strip end end |
#record_reference ⇒ String
26 |
# File 'lib/onix/product.rb', line 26 element "RecordReference", :text, :cardinality => 1 |
#record_source_identifiers ⇒ Array<RecordSourceIdentifier>
30 |
# File 'lib/onix/product.rb', line 30 elements "RecordSourceIdentifier", :subset, :cardinality => 0..n |
#record_source_name ⇒ String
31 |
# File 'lib/onix/product.rb', line 31 element "RecordSourceName", :text, :cardinality => 0..1 |
#record_source_type ⇒ RecordSourceType
29 |
# File 'lib/onix/product.rb', line 29 element "RecordSourceType", :subset, :cardinality => 0..1 |
#reflowable? ⇒ Boolean
Forwarded to DescriptiveDetail#reflowable?
84 |
# File 'lib/onix/product.rb', line 84 def_delegator :descriptive_detail, :reflowable? |
#related ⇒ Array
return every related subset
237 238 239 240 241 242 243 |
# File 'lib/onix/product.rb', line 237 def if @related_material (@related_material. + @related_material.) else [] end end |
#related_material ⇒ RelatedMaterial
42 |
# File 'lib/onix/product.rb', line 42 element "RelatedMaterial", :subset, :cardinality => 0..1 |
#sales_restriction ⇒ SalesRestriction
Forwarded to ONIX::PublishingDetail#sales_restriction
102 |
# File 'lib/onix/product.rb', line 102 def_delegator :publishing_detail, :sales_restriction |
#sold_separately? ⇒ Boolean
product can be sold separately ?
145 146 147 148 149 |
# File 'lib/onix/product.rb', line 145 def sold_separately? @product_supplies.map { |product_supply| product_supply.supply_details.map { |supply_detail| supply_detail.sold_separately? }.flatten }.flatten.uniq.first end |
#streaming? ⇒ Boolean
Forwarded to DescriptiveDetail#streaming?
75 |
# File 'lib/onix/product.rb', line 75 def_delegator :descriptive_detail, :streaming? |
#subjects ⇒ Array<Subject>
Forwarded to DescriptiveDetail#subjects
86 |
# File 'lib/onix/product.rb', line 86 def_delegator :descriptive_detail, :subjects |
#subtitle ⇒ String
Forwarded to DescriptiveDetail#subtitle
62 |
# File 'lib/onix/product.rb', line 62 def_delegator :descriptive_detail, :subtitle |
#title ⇒ Object
61 |
# File 'lib/onix/product.rb', line 61 def_delegator :descriptive_detail, :title |