class RuboCop::Cop::RSpec::Language::SelectorSet

Set of method selectors

Attributes

selectors[R]

Public Class Methods

new(selectors) click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 14
def initialize(selectors)
  @selectors = selectors
end

Public Instance Methods

+(other) click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 22
def +(other)
  self.class.new(selectors + other.selectors)
end
==(other) click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 18
def ==(other)
  selectors.eql?(other.selectors)
end
block_pattern() click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 30
def block_pattern
  "(block #{send_pattern} ...)"
end
include?(selector) click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 26
def include?(selector)
  selectors.include?(selector)
end
node_pattern() click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 42
def node_pattern
  selectors.map(&:inspect).join(" ")
end
node_pattern_union() click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 38
def node_pattern_union
  "{#{node_pattern}}"
end
send_pattern() click to toggle source
# File lib/test_prof/cops/rspec/language.rb, line 34
def send_pattern
  "(send #{RSPEC} #{node_pattern_union} ...)"
end