lib/infoboxer/media_wiki/traits.rb in infoboxer-0.2.1 vs lib/infoboxer/media_wiki/traits.rb in infoboxer-0.2.2
- old
+ new
@@ -57,10 +57,11 @@
#
# Again, you can look at current
# [English Wikipedia traits](https://github.com/molybdenum-99/infoboxer/blob/master/lib/infoboxer/definitions/en.wikipedia.org.rb)
# for example implementation.
def for(domain, &block)
- Class.new(self, &block).domain(domain)
+ Traits.domains[domain].tap{|c| c && c.instance_eval(&block)} ||
+ Class.new(self, &block).domain(domain)
end
# @private
alias_method :default, :new
end