Class: RuboCop::RSpec::Concept

Inherits:
Object
  • Object
show all
Extended by:
NodePattern::Macros
Includes:
Language
Defined in:
lib/rubocop/rspec/concept.rb

Overview

Wrapper for RSpec DSL methods

Direct Known Subclasses

Example, ExampleGroup, Hook

Instance Method Summary collapse

Methods included from Language

#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?

Constructor Details

#initialize(node) ⇒ Concept

Returns a new instance of Concept.



10
11
12
# File 'lib/rubocop/rspec/concept.rb', line 10

def initialize(node)
  @node = node
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubocop/rspec/concept.rb', line 14

def eql?(other)
  node == other.node
end

#hashObject



20
21
22
# File 'lib/rubocop/rspec/concept.rb', line 20

def hash
  [self.class, node].hash
end

#to_nodeObject



24
25
26
# File 'lib/rubocop/rspec/concept.rb', line 24

def to_node
  node
end