Class: Sqs::Queue

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Parser
Defined in:
lib/sqs/queue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Parser

#parse_create_queue_result, #parse_error, #parse_get_queue_attributes_result, #parse_list_queues_result, #parse_receive_message_result, #rexml_document

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/sqs/queue.rb', line 6

def name
  @name
end

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/sqs/queue.rb', line 6

def path
  @path
end

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/sqs/queue.rb', line 6

def service
  @service
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/sqs/queue.rb', line 10

def ==(other)
  self.name == other.name and self.service == other.service
end

#attributesObject



19
20
21
# File 'lib/sqs/queue.rb', line 19

def attributes
  get_queue_attributes
end

#create_message(body) ⇒ Object



28
29
30
31
# File 'lib/sqs/queue.rb', line 28

def create_message(body)
  send_message("MessageBody" => body)
  true
end

#destroyObject



14
15
16
17
# File 'lib/sqs/queue.rb', line 14

def destroy
  delete_queue
  true
end

#inspectObject

:nodoc:



39
40
41
# File 'lib/sqs/queue.rb', line 39

def inspect #:nodoc:
  "#<#{self.class}:#{name}>"
end

#message(visibility_timeout = nil) ⇒ Object



33
34
35
36
37
# File 'lib/sqs/queue.rb', line 33

def message(visibility_timeout = nil)
  options = {}
  options["VisibilityTimeout"] = visibility_timeout.to_s if visibility_timeout
  receive_message(options).first
end

#update_attributes(attributes) ⇒ Object



23
24
25
26
# File 'lib/sqs/queue.rb', line 23

def update_attributes(attributes)
  set_queue_attributes(attributes)
  true
end