Module: Tokamak::Builder

Defined in:
lib/tokamak/builder.rb,
lib/tokamak/builder/xml.rb,
lib/tokamak/builder/base.rb,
lib/tokamak/builder/json.rb,
lib/tokamak/builder/values.rb

Defined Under Namespace

Classes: Base, Json, Values, Xml

Class Method Summary collapse

Class Method Details

.helper_module_for(const) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tokamak/builder.rb', line 8

def self.helper_module_for(const)
  mod = Module.new
  mod.module_eval "    def collection(obj, *args, &block)\n      \#{const.name}.build(obj, *args, &block)\n    end\n\n    alias_method :member, :collection\n  EOS\n  mod\nend\n"