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

Class Method Summary collapse

Methods inherited from Code

from_code, from_human

Methods included from CodeHelper

#human, #onix, #parse

Methods inherited from Subset

parse, #parse, tag_match, #tag_match, #unsupported

Class Method Details

.code_identObject



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

def self.code_ident
  nil
end

.hashObject



35
36
37
# File 'lib/onix/onix21.rb', line 35

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

.listObject



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

def self.list
  self.hash.to_a.map{|h| h.first}
end