2011-03-16 19:32:50 +00:00
|
|
|
module AVM
|
|
|
|
module ControlledVocabulary
|
|
|
|
class << self
|
|
|
|
def included(klass)
|
|
|
|
klass::TERMS.each do |type|
|
|
|
|
new_klass = Class.new do
|
|
|
|
def to_s
|
|
|
|
self.class.to_s.split('::').last
|
|
|
|
end
|
2011-03-17 17:30:19 +00:00
|
|
|
|
|
|
|
def ==(other)
|
|
|
|
self.to_s == other.to_s
|
|
|
|
end
|
2011-03-16 19:32:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
klass.const_set(type.to_sym, new_klass)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|