class Elibri::ONIX::Release_3_0::Language

Attributes

to_xml[R]

reprezentacja w xml

Public Class Methods

new(data) click to toggle source
# File lib/elibri_onix/onix_3_0/language.rb, line 37
def initialize(data)
  @to_xml = data.to_s
  @role = data.at_css('LanguageRole').try(:text)
  @code = data.at_css('LanguageCode').try(:text)
end

Public Instance Methods

inspect_include_fields() click to toggle source
# File lib/elibri_onix/onix_3_0/language.rb, line 55
def inspect_include_fields
   [:role_name, :language]
end
language() click to toggle source

język, np. ‘polski’

# File lib/elibri_onix/onix_3_0/language.rb, line 49
def language
  Elibri::ONIX::Dict::Release_3_0::LanguageCode.find_by_onix_code(@code).name(:pl).downcase rescue nil
rescue 

end
role_name() click to toggle source

określenie roli jako string, np. language_of_text

# File lib/elibri_onix/onix_3_0/language.rb, line 44
def role_name
  Elibri::ONIX::Dict::Release_3_0::LanguageRole.find_by_onix_code(@role).const_name.downcase
end