Class: Arspy::Operators::Selector::RangeSelector

Inherits:
Base
  • Object
show all
Defined in:
lib/arspy/operators/selector/range_selector.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Arspy::Operators::Selector::Base

Class Method Details

.applies?(arg) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/arspy/operators/selector/range_selector.rb', line 6

def self.applies?(arg)
  arg.is_a? Range
end

Instance Method Details

#select?(obj) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/arspy/operators/selector/range_selector.rb', line 10

def select?(obj)
  @argument.include?(obj.id)
end