Class: ONIX::CodeFromYaml
Direct Known Subclasses
AgentIDType, AgentRole, AudienceCode, CodeFromYamlWithMime, CollectionIDType, CollectionSequenceType, CollectionType, ContentAudience, ContentDateRole, ContributorPlaceRelator, ContributorRole, CountryCode, DateFormat, EditionType, EpubTechnicalProtection, EpubUsageStatus, EpubUsageType, EpubUsageUnit, ExtentType, ExtentUnit, IDType, LanguageCode, LanguageRole, MarketDateRole, MarketPublishingStatus, NotificationType, PriceDateRole, PriceQualifier, PriceStatus, PriceType, ProductAvailability, ProductComposition, ProductContentType, ProductForm, ProductFormFeatureType, ProductIDType, ProductRelationCode, PublishingDateRole, PublishingRole, PublishingStatus, RegionCode, ResourceContentType, ResourceFeatureType, ResourceForm, ResourceMode, ResourceVersionFeatureType, SalesOutletIDType, SalesRestrictionType, SalesRightsType, SubjectSchemeIdentifier, SupplierIDType, SupplierRole, SupplyDateRole, TaxRateCode, TaxType, TextType, TitleElementLevel, TitleType, UnpricedItemType, WebsiteRole, WorkIDType, WorkRelationCode
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_ident ⇒ Object
62
63
64
|
# File 'lib/onix/code.rb', line 62
def self.code_ident
nil
end
|
.hash ⇒ Object
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
|
.list ⇒ Object
58
59
60
|
# File 'lib/onix/code.rb', line 58
def self.list
self.hash.to_a.map{|h| h.first}
end
|