Sha256: a3648e1568ea657070495ea2cffe1857627d9ceb3dd808ff24cdcd2d40ec8f47

Contents?: true

Size: 662 Bytes

Versions: 15

Compression:

Stored size: 662 Bytes

Contents

module GraphQL
  module Define
    class DefinedObjectProxy
      def initialize(target, dictionary)
        @target = target
        @dictionary = dictionary
      end

      def types
        GraphQL::Define::TypeDefiner.instance
      end

      def method_missing(name, *args, &block)
        definition = @dictionary[name]
        if definition
          definition.call(@target, *args, &block)
        else
          p "Failed to find config #{name} in #{inspect}"
          super
        end
      end

      def to_s
        inspect
      end

      def inspect
        "<DefinedObjectProxy #{@target} (#{@dictionary.keys})>"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
graphql-0.17.2 lib/graphql/define/defined_object_proxy.rb
graphql-0.17.1 lib/graphql/define/defined_object_proxy.rb
graphql-0.17.0 lib/graphql/define/defined_object_proxy.rb
graphql-0.16.1 lib/graphql/define/defined_object_proxy.rb
graphql-0.16.0 lib/graphql/define/defined_object_proxy.rb
graphql-0.15.3 lib/graphql/define/defined_object_proxy.rb
graphql-0.15.2 lib/graphql/define/defined_object_proxy.rb
graphql-0.14.2 lib/graphql/define/defined_object_proxy.rb
graphql-0.15.1 lib/graphql/define/defined_object_proxy.rb
graphql-0.15.0 lib/graphql/define/defined_object_proxy.rb
graphql-0.14.1 lib/graphql/define/defined_object_proxy.rb
graphql-0.14.0 lib/graphql/define/defined_object_proxy.rb
graphql-0.13.0 lib/graphql/define/defined_object_proxy.rb
graphql-0.12.1 lib/graphql/define/defined_object_proxy.rb
graphql-0.12.0 lib/graphql/define/defined_object_proxy.rb