Class: ONIX::ONIX21::CodeFromYaml

Inherits:
Code show all
Defined in:
lib/onix/onix21.rb

Overview

ONIX 2.1 codes

Instance Attribute Summary

Attributes inherited from Code

#code, #human

Attributes included from Attributes

#attributes

Class Method Summary collapse

Methods inherited from Code

from_code, from_human

Methods included from CodeMethods

#human, #onix, #parse

Methods inherited from Subset

parse, #parse, #tag_match, #unsupported

Methods included from Attributes

attribute_class, #parse_attributes, #serialized_attributes

Class Method Details

.code_identObject



46
47
48
# File 'lib/onix/onix21.rb', line 46

def self.code_ident
  nil
end

.hashObject



38
39
40
# File 'lib/onix/onix21.rb', line 38

def self.hash
  @hash ||= YAML.load(File.open(File.dirname(__FILE__) + "/../../data/onix21/codelists/codelist-#{self.code_ident}.yml"))[:codelist].freeze
end

.listObject



42
43
44
# File 'lib/onix/onix21.rb', line 42

def self.list
  self.hash.keys
end