Module: Lark::Helper::ClassMethods

Defined in:
lib/lark/helper.rb

Instance Method Summary collapse

Instance Method Details

#api_mount(name) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/lark/helper.rb', line 6

def api_mount(name)
  class_eval "    def \#{name.to_s.gsub('/', '_')}\n      @\#{name.to_s.gsub('/', '_')} ||= Class.new(SimpleDelegator) do\n        include ::Lark::Apis::\#{name.to_s.classify}\n      end.new(self)\n    end\n  CODE\nend\n", __FILE__, __LINE__ + 1