Class: Elibri::ONIX::Release_3_0::Publisher
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::Publisher
- Includes:
- Inspector
- Defined in:
- lib/elibri_onix/onix_3_0/publisher.rb
Constant Summary collapse
- ATTRIBUTES =
[ :role, :name, :eid ]
- RELATIONS =
[]
Instance Attribute Summary collapse
-
#eid ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca.
-
#name ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca.
-
#role ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca.
-
#to_xml ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(data) ⇒ Publisher
constructor
A new instance of Publisher.
- #inspect_include_fields ⇒ Object
Methods included from Inspector
#attribute_for_inspect, #inspect
Constructor Details
#initialize(data) ⇒ Publisher
Returns a new instance of Publisher.
28 29 30 31 32 33 34 35 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 28 def initialize(data) @to_xml = data.to_s @role = data.at_xpath('xmlns:PublishingRole').try(:text) @name = data.at_xpath('xmlns:PublisherName').try(:text) if data.at_xpath('xmlns:PublisherIdentifier') @eid = data.at_xpath('xmlns:PublisherIdentifier').at_xpath('xmlns:IDValue').try(:text).try(:to_i) end end |
Instance Attribute Details
#eid ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
26 27 28 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 26 def eid @eid end |
#name ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
26 27 28 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 26 def name @name end |
#role ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
26 27 28 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 26 def role @role end |
#to_xml ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
26 27 28 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 26 def to_xml @to_xml end |
Instance Method Details
#id ⇒ Object
41 42 43 44 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 41 def id Kernel.warn "[DEPRECATION] `id` is deprecated. Please use `eid` instead." @eid end |
#inspect_include_fields ⇒ Object
37 38 39 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 37 def inspect_include_fields [:eid, :name] end |