class ONIX::Code
Attributes
code[RW]
@!attribute code
@return [String] code as defined in ONIX documentation codelist
human[RW]
@!attribute human
@return [String] humanized string (eg: "Digital watermarking" become DigitalWatermarking, "PDF" become Pdf, "BISAC Subject Heading" become BisacSubjectHeading, etc)
Public Class Methods
from_code(code)
click to toggle source
from_human(human)
click to toggle source
create Code
from human readable code @param [String] human human readable code @return [Code]
# File lib/onix/code.rb, line 50 def self.from_human(human) obj = self.new obj.human = human obj.code = self.hash.key(human) unless obj.code raise InvalidCodeAlias, [self.to_s, human] end obj end
Private Class Methods
hash()
click to toggle source
# File lib/onix/code.rb, line 62 def self.hash {} end