Class: Reqless::QueuePriorityPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/reqless/queue_priority_pattern.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, should_distribute_fairly = false) ⇒ QueuePriorityPattern

Returns a new instance of QueuePriorityPattern.



5
6
7
8
# File 'lib/reqless/queue_priority_pattern.rb', line 5

def initialize(pattern, should_distribute_fairly = false)
  @pattern = pattern
  @should_distribute_fairly = should_distribute_fairly
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



3
4
5
# File 'lib/reqless/queue_priority_pattern.rb', line 3

def pattern
  @pattern
end

#should_distribute_fairlyObject (readonly)

Returns the value of attribute should_distribute_fairly.



3
4
5
# File 'lib/reqless/queue_priority_pattern.rb', line 3

def should_distribute_fairly
  @should_distribute_fairly
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
14
# File 'lib/reqless/queue_priority_pattern.rb', line 10

def ==(other)
  return self.class == other.class &&
    self.pattern.join == other.pattern.join &&
    self.should_distribute_fairly == other.should_distribute_fairly
end