Class: RuboCop::RSpec::Language::SelectorSet

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/rspec/language.rb

Overview

Set of method selectors

Instance Method Summary collapse

Constructor Details

#initialize(selectors) ⇒ SelectorSet

Returns a new instance of SelectorSet.



9
10
11
# File 'lib/rubocop/rspec/language.rb', line 9

def initialize(selectors)
  @selectors = selectors
end

Instance Method Details

#+(other) ⇒ Object



17
18
19
# File 'lib/rubocop/rspec/language.rb', line 17

def +(other)
  self.class.new(selectors + other.selectors)
end

#==(other) ⇒ Object



13
14
15
# File 'lib/rubocop/rspec/language.rb', line 13

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

#include?(selector) ⇒ Boolean

Returns:

  • (Boolean)


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

def include?(selector)
  selectors.include?(selector)
end

#to_node_patternObject



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

def to_node_pattern
  selectors.map(&:inspect).join(' ')
end