Class: RuboCop::GraphQL::Class

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Class

Returns a new instance of Class.



8
9
10
# File 'lib/rubocop/graphql/class.rb', line 8

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



6
7
8
# File 'lib/rubocop/graphql/class.rb', line 6

def node
  @node
end

Instance Method Details

#nested?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rubocop/graphql/class.rb', line 12

def nested?
  node.each_ancestor(:class).any?
end