Class: RuboCop::RSpec::Language::SelectorSet
- Inherits:
-
Object
- Object
- RuboCop::RSpec::Language::SelectorSet
- Defined in:
- lib/rubocop/rspec/language.rb
Overview
Set of method selectors
Instance Method Summary collapse
- #+(other) ⇒ Object
- #==(other) ⇒ Object
- #include?(selector) ⇒ Boolean
-
#initialize(selectors) ⇒ SelectorSet
constructor
A new instance of SelectorSet.
- #to_node_pattern ⇒ Object
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
21 22 23 |
# File 'lib/rubocop/rspec/language.rb', line 21 def include?(selector) selectors.include?(selector) end |
#to_node_pattern ⇒ Object
25 26 27 |
# File 'lib/rubocop/rspec/language.rb', line 25 def to_node_pattern selectors.map(&:inspect).join(' ') end |