Class: Elibri::ONIX::Release_3_0::ThemaSubject

Inherits:
Object
  • Object
show all
Includes:
HashId
Defined in:
lib/elibri_onix/onix_3_0/thema_subject.rb

Overview

Kategoria Themy

Constant Summary collapse

ATTRIBUTES =
[
  :code, :heading_text
]
RELATIONS =
[
  :inspect_include_fields
]

Constants included from HashId

HashId::SKIPPED_2, HashId::SKIPPED_ATTRIBS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashId

#calculate_hash, #eid

Constructor Details

#initialize(data) ⇒ ThemaSubject

Returns a new instance of ThemaSubject.



21
22
23
24
25
# File 'lib/elibri_onix/onix_3_0/thema_subject.rb', line 21

def initialize(data)
  @to_xml = data.to_s
  @code = data.at_css('SubjectCode').try(:text)
  @heading_text = data.at_css('SubjectHeadingText').try(:text)
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



19
20
21
# File 'lib/elibri_onix/onix_3_0/thema_subject.rb', line 19

def code
  @code
end

#heading_textObject

Returns the value of attribute heading_text.



19
20
21
# File 'lib/elibri_onix/onix_3_0/thema_subject.rb', line 19

def heading_text
  @heading_text
end

#to_xmlObject

Returns the value of attribute to_xml.



19
20
21
# File 'lib/elibri_onix/onix_3_0/thema_subject.rb', line 19

def to_xml
  @to_xml
end

Instance Method Details

#inspect_include_fieldsObject



27
28
29
# File 'lib/elibri_onix/onix_3_0/thema_subject.rb', line 27

def inspect_include_fields
  [:code]
end