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
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
-
#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.
11 12 13 14 15 16 17 18 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 11 def initialize(data) @to_xml = data.to_s @role = data.at_css('PublishingRole')&.text @name = data.at_css('PublisherName')&.text if data.at_css('PublisherIdentifier') @eid = data.at_css('PublisherIdentifier').at_css('IDValue')&.text&.to_i end end |
Instance Attribute Details
#eid ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
9 10 11 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 9 def eid @eid end |
#name ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
9 10 11 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 9 def name @name end |
#role ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
9 10 11 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 9 def role @role end |
#to_xml ⇒ Object
role występuje w tej chwili tylko 01 - główny wydawca
9 10 11 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 9 def to_xml @to_xml end |
Instance Method Details
#inspect_include_fields ⇒ Object
20 21 22 |
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 20 def inspect_include_fields [:eid, :name] end |