Class: Rails::GraphQL::Field::ScopedConfig
- Inherits:
-
Struct
- Object
- Struct
- Rails::GraphQL::Field::ScopedConfig
- Defined in:
- lib/rails/graphql/field/scoped_config.rb
Overview
Helper class to be used while configuring a field using a block. An instance of this class works as proxy for changes to the actual field.
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
- #desc(value) ⇒ Object (also: #description)
- #method_name(value) ⇒ Object
- #rename!(name) ⇒ Object
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field
7 8 9 |
# File 'lib/rails/graphql/field/scoped_config.rb', line 7 def field @field end |
#receiver ⇒ Object
Returns the value of attribute receiver
7 8 9 |
# File 'lib/rails/graphql/field/scoped_config.rb', line 7 def receiver @receiver end |
Instance Method Details
#desc(value) ⇒ Object Also known as: description
21 22 23 |
# File 'lib/rails/graphql/field/scoped_config.rb', line 21 def desc(value) field.description = value end |
#method_name(value) ⇒ Object
17 18 19 |
# File 'lib/rails/graphql/field/scoped_config.rb', line 17 def method_name(value) field.instance_variable_set(:@method_name, value.to_sym) end |
#rename!(name) ⇒ Object
13 14 15 |
# File 'lib/rails/graphql/field/scoped_config.rb', line 13 def rename!(name) field.instance_variable_set(:@gql_name, name.to_s) end |