Skip to content

added IDTypeName to the product identifier model #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/onix.rb
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ def self.two_digit
require "onix/contributor"
require "onix/language"
require "onix/subject"
require "onix/mainsubject"
require "onix/audience_range"
require "onix/imprint"
require "onix/publisher"
14 changes: 14 additions & 0 deletions lib/onix/mainsubject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# coding: utf-8

module ONIX
class MainSubject
include ROXML

xml_name "MainSubject"

xml_accessor :mainsubject_scheme_id, :from => "MainSubjectSchemeIdentifier", :as => Fixnum, :to_xml => ONIX::Formatters.two_digit
xml_accessor :subject_scheme_version, :from => "SubjectSchemeVersion"
xml_accessor :subject_code, :from => "SubjectCode"
xml_accessor :subject_heading_text, :from => "SubjectHeadingText"
end
end
1 change: 1 addition & 0 deletions lib/onix/product.rb
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ class Product
xml_accessor :number_of_pages, :from => "NumberOfPages", :as => Fixnum
xml_accessor :basic_main_subject, :from => "BASICMainSubject"
xml_accessor :bic_main_subject, :from => "BICMainSubject"
xml_accessor :mainsubject, :from => "MainSubject", :as => ONIX::MainSubject
xml_accessor :subjects, :from => "Subject", :as => [ONIX::Subject]
xml_accessor :audience_code, :from => "AudienceCode", :to_xml => ONIX::Formatters.two_digit
xml_accessor :audience_ranges, :from => "AudienceRange", :as => [ONIX::AudienceRange]
1 change: 1 addition & 0 deletions lib/onix/product_identifier.rb
Original file line number Diff line number Diff line change
@@ -8,5 +8,6 @@ class ProductIdentifier

xml_accessor :product_id_type, :from => "ProductIDType", :as => Fixnum, :to_xml => ONIX::Formatters.two_digit
xml_accessor :id_value, :from => "IDValue"
xml_accessor :id_type_name, :from => "IDTypeName"
end
end