Class: SQSAttributes

Inherits:
Object
  • Object
show all
Extended by:
SQS::Utilities
Defined in:
lib/sqs_async/sqs_attributes.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from SQS::Utilities

action_from_caller, camelize, underscore

Instance Attribute Details

#approximate_number_of_messagesObject

Returns the value of attribute approximate_number_of_messages.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def approximate_number_of_messages
  @approximate_number_of_messages
end

#approximate_number_of_messages_not_visibleObject

Returns the value of attribute approximate_number_of_messages_not_visible.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def approximate_number_of_messages_not_visible
  @approximate_number_of_messages_not_visible
end

#create_timestampObject

Returns the value of attribute create_timestamp.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def create_timestamp
  @create_timestamp
end

#last_modified_timestampObject

Returns the value of attribute last_modified_timestamp.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def last_modified_timestamp
  @last_modified_timestamp
end

#maximum_message_sizeObject

Returns the value of attribute maximum_message_size.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def maximum_message_size
  @maximum_message_size
end

#message_retention_periodObject

Returns the value of attribute message_retention_period.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def message_retention_period
  @message_retention_period
end

#policyObject

Returns the value of attribute policy.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def policy
  @policy
end

#queue_arnObject

Returns the value of attribute queue_arn.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def queue_arn
  @queue_arn
end

#visibility_timeoutObject

Returns the value of attribute visibility_timeout.



10
11
12
# File 'lib/sqs_async/sqs_attributes.rb', line 10

def visibility_timeout
  @visibility_timeout
end

Class Method Details

.parse(xml) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sqs_async/sqs_attributes.rb', line 20

def self.parse(xml)
  doc = Nokogiri::XML(xml)
  queue_data = SQSAttributes.new
  doc.search("Attribute").each do |attribute|
    meth = underscore(attribute.at("Name").text.strip)
    if queue_data.respond_to? meth.to_sym
      queue_data.send "#{meth}=", attribute.at("Value").text.strip
    end
  end
  queue_data
end