Class: ActiveGraphql::Model::Configuration::Attribute
- Inherits:
-
Object
- Object
- ActiveGraphql::Model::Configuration::Attribute
- Defined in:
- lib/active_graphql/model/configuration.rb
Instance Attribute Summary collapse
-
#decorate_with ⇒ Object
readonly
Returns the value of attribute decorate_with.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nesting ⇒ Object
readonly
Returns the value of attribute nesting.
Instance Method Summary collapse
-
#initialize(name, nesting: nil, decorate_with: nil) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_graphql_output ⇒ Object
Constructor Details
#initialize(name, nesting: nil, decorate_with: nil) ⇒ Attribute
Returns a new instance of Attribute.
10 11 12 13 14 |
# File 'lib/active_graphql/model/configuration.rb', line 10 def initialize(name, nesting: nil, decorate_with: nil) @name = name.to_sym @nesting = nesting @decorate_with = decorate_with end |
Instance Attribute Details
#decorate_with ⇒ Object (readonly)
Returns the value of attribute decorate_with.
8 9 10 |
# File 'lib/active_graphql/model/configuration.rb', line 8 def decorate_with @decorate_with end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/active_graphql/model/configuration.rb', line 8 def name @name end |
#nesting ⇒ Object (readonly)
Returns the value of attribute nesting.
8 9 10 |
# File 'lib/active_graphql/model/configuration.rb', line 8 def nesting @nesting end |
Instance Method Details
#to_graphql_output ⇒ Object
16 17 18 |
# File 'lib/active_graphql/model/configuration.rb', line 16 def to_graphql_output nesting ? { name => nesting } : name end |