lib/bbcoder/configuration.rb in bbcoder-1.0.1 vs lib/bbcoder/configuration.rb in bbcoder-1.1.0

- old
+ new

@@ -1,29 +1,25 @@ class BBCoder class Configuration - @@tags = {} + attr_accessor :tags + def initialize + @tags = {} + end + def [](value) - @@tags[value] + @tags[value] end def clear - @@tags = {} + @tags = {} end def remove name - @@tags.delete(name.to_sym) + @tags.delete(name.to_sym) end def tag(name, options = {}, &block) - unless block.nil? - block.binding.eval <<-EOS - def meta; @meta; end - def content; @content; end - def singular?; @singularity; end - EOS - end - @@tags[name.to_sym] = BBCoder::Tag.new(name.to_sym, options.merge(:block => block)) + @tags[name.to_sym] = BBCoder::Tag.new(name.to_sym, options.merge(:block => block)) end end end -