Class: RuboCop::RSpec::Concept

Inherits:
Object
  • Object
show all
Extended by:
NodePattern::Macros, Language::NodePattern
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::NodePattern

block_pattern, send_pattern

Methods included from Language

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

Constructor Details

#initialize(node) ⇒ Concept

Returns a new instance of Concept.


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

def initialize(node)
  @node = node
end

Instance Method Details

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

Returns:

  • (Boolean)

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

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

#hashObject


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

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

#to_nodeObject


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

def to_node
  node
end