Module: Hugger::ClassMethods
- Defined in:
- lib/hugger/huggable.rb
Overview
Haggable class methods
Instance Method Summary collapse
-
#hug_string(*args) ⇒ Object
Decorates object from given method using the Hugger classes.
Instance Method Details
#hug_string(*args) ⇒ Object
Decorates object from given method using the Hugger classes
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/hugger/huggable.rb', line 25 def hug_string(*args) m = Module.new args.each do |method| m.class_eval " def \#{method}(*args)\n Hugger::String.new(super(*args))\n end\n STRING_WRAPPER\n end\n prepend(m)\nend\n", __FILE__, __LINE__ + 1 |