Sha256: f22e7e115017643f43f5f1157103707fc239116c2a7c604a242e70b9b73e10de

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

module Tokamak
  module Builder
    require "tokamak/builder/base"
    require "tokamak/builder/values"
    require "tokamak/builder/json"
    require "tokamak/builder/xml"

    def self.helper_module_for(const)
      mod = Module.new
      mod.module_eval <<-EOS
        def collection(obj, *args, &block)
          #{const.name}.build(obj, *args, &block)
        end

        def member(obj, *args, &block)
          #{const.name}.build(obj, *args, &block)
        end
      EOS
      mod
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokamak-1.1.2 lib/tokamak/builder.rb