Class: GraphQL::BackwardsCompatibility::ArityWrapper Private

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/backwards_compatibility.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(callable, old_arity) ⇒ ArityWrapper

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ArityWrapper.



36
37
38
39
# File 'lib/graphql/backwards_compatibility.rb', line 36

def initialize(callable, old_arity)
  @callable = callable
  @old_arity = old_arity
end

Instance Method Details

#call(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
44
# File 'lib/graphql/backwards_compatibility.rb', line 41

def call(*args)
  backwards_compat_args = args.first(@old_arity)
  @callable.call(*backwards_compat_args)
end