Class: Minuteman::BitOperations::Operation
- Inherits:
-
Struct
- Object
- Struct
- Minuteman::BitOperations::Operation
- Defined in:
- lib/minuteman/bit_operations/operation.rb
Overview
Public: Handles the operations between two timespans
redis: The Redis connection
type: The operation type
timespan: One of the timespans to be permuted
other: The other timespan to be permuted
Instance Attribute Summary collapse
-
#other ⇒ Object
Returns the value of attribute other.
-
#redis ⇒ Object
Returns the value of attribute redis.
-
#timespan ⇒ Object
Returns the value of attribute timespan.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#other ⇒ Object
Returns the value of attribute other
13 14 15 |
# File 'lib/minuteman/bit_operations/operation.rb', line 13 def other @other end |
#redis ⇒ Object
Returns the value of attribute redis
13 14 15 |
# File 'lib/minuteman/bit_operations/operation.rb', line 13 def redis @redis end |
#timespan ⇒ Object
Returns the value of attribute timespan
13 14 15 |
# File 'lib/minuteman/bit_operations/operation.rb', line 13 def timespan @timespan end |
#type ⇒ Object
Returns the value of attribute type
13 14 15 |
# File 'lib/minuteman/bit_operations/operation.rb', line 13 def type @type end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/minuteman/bit_operations/operation.rb', line 14 def call if type == "MINUS" && operable? return timespan ^ (timespan & other) end klass.new(redis, type, other, timespan.key).call end |