Class: ONIX::CodeFromYaml

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

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



62
63
64
# File 'lib/onix/code.rb', line 62

def self.code_ident
  nil
end

.hashObject



54
55
56
# File 'lib/onix/code.rb', line 54

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

.listObject



58
59
60
# File 'lib/onix/code.rb', line 58

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