class GraphQL::Rails::DSL

Object that runs a block in the context of itself, but delegates unknown methods back to the block's original context. This is useful for creating DSLs to aid with object initialization.

Note that this class extends from BasicObject, which means that all global classes and modules must be prefixed by a double-colon (::) in order to resolve.

Public Instance Methods

run(&block) click to toggle source
# File lib/graphql/rails/dsl.rb, line 11
def run(&block)
  @self = eval('self', block.binding)
  instance_eval(&block)
end

Private Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/graphql/rails/dsl.rb, line 18
def method_missing(method, *args, &block)
  begin
    @self.send(method, *args, &block)
  rescue
    super
  end
end