Class: Rails::GraphQL::Request::Arguments::Lazy

Inherits:
Delegator
  • Object
show all
Defined in:
lib/rails/graphql/request/arguments.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(var_name) ⇒ Lazy

Returns a new instance of Lazy.



25
26
27
# File 'lib/rails/graphql/request/arguments.rb', line 25

def initialize(var_name)
  @var_name = var_name
end

Instance Attribute Details

#var_nameObject (readonly)

Returns the value of attribute var_name.



19
20
21
# File 'lib/rails/graphql/request/arguments.rb', line 19

def var_name
  @var_name
end

Class Method Details

.[](key) ⇒ Object



21
22
23
# File 'lib/rails/graphql/request/arguments.rb', line 21

def self.[](key)
  new(key)
end

Instance Method Details

#__getobj__Object



29
30
31
# File 'lib/rails/graphql/request/arguments.rb', line 29

def __getobj__
  Arguments.operation&.variables&.dig(var_name)
end

#__setobj__Object

Raises:

  • (FrozenError)


33
34
35
# File 'lib/rails/graphql/request/arguments.rb', line 33

def __setobj__(*)
  raise FrozenError
end