Class: ActiveMessaging::Adapters::AmazonSqs::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/activemessaging/adapters/asqs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination, headers = {}, count = 1) ⇒ Subscription

Returns a new instance of Subscription.



430
431
432
433
# File 'lib/activemessaging/adapters/asqs.rb', line 430

def initialize(destination, headers={}, count=1)
  @priority = headers.delete(:priority) || 1001
  @destination, @headers, @count = destination, headers, count
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



428
429
430
# File 'lib/activemessaging/adapters/asqs.rb', line 428

def count
  @count
end

#destinationObject

Returns the value of attribute destination.



428
429
430
# File 'lib/activemessaging/adapters/asqs.rb', line 428

def destination
  @destination
end

#headersObject

Returns the value of attribute headers.



428
429
430
# File 'lib/activemessaging/adapters/asqs.rb', line 428

def headers
  @headers
end

#priorityObject

Returns the value of attribute priority.



428
429
430
# File 'lib/activemessaging/adapters/asqs.rb', line 428

def priority
  @priority
end

Instance Method Details

#addObject



435
436
437
# File 'lib/activemessaging/adapters/asqs.rb', line 435

def add
  @count += 1
end

#removeObject



439
440
441
# File 'lib/activemessaging/adapters/asqs.rb', line 439

def remove
  @count -= 1
end