Class: Elibri::ONIX::Release_3_0::Publisher

Inherits:
Object
  • Object
show all
Includes:
Inspector
Defined in:
lib/elibri_onix/onix_3_0/publisher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#eidObject

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

#nameObject

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

#roleObject

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_xmlObject

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_fieldsObject



20
21
22
# File 'lib/elibri_onix/onix_3_0/publisher.rb', line 20

def inspect_include_fields
  [:eid, :name]
end