Class: ActiveGraphql::Model::Configuration::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/active_graphql/model/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_withObject (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

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/active_graphql/model/configuration.rb', line 8

def name
  @name
end

#nestingObject (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_outputObject



16
17
18
# File 'lib/active_graphql/model/configuration.rb', line 16

def to_graphql_output
  nesting ? { name => nesting } : name
end