Class: LSQS::Actions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lsqs/actions/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_list) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/lsqs/actions/base.rb', line 7

def initialize(queue_list)
  @queue_list = queue_list
end

Instance Attribute Details

#builderBuilder::XmlMarkup (readonly)

Initializes a XML builder.

Returns:

  • (Builder::XmlMarkup)


25
26
27
# File 'lib/lsqs/actions/base.rb', line 25

def builder
  @builder
end

#queue_listObject

Returns the value of attribute queue_list.



4
5
6
# File 'lib/lsqs/actions/base.rb', line 4

def queue_list
  @queue_list
end

Instance Method Details

#build_url(base_url, queue_name) ⇒ String

Returns:

  • (String)


46
47
48
# File 'lib/lsqs/actions/base.rb', line 46

def build_url(base_url, queue_name)
  return "#{base_url}/#{queue_name}"
end

#nameString

Returns the name of the class without namespacing.

Returns:

  • (String)


16
17
18
# File 'lib/lsqs/actions/base.rb', line 16

def name
  return self.class.name.split('::').last
end

#to_xmlString

Outputs XML from the builder as a string.

Returns:

  • (String)


34
35
36
# File 'lib/lsqs/actions/base.rb', line 34

def to_xml
  builder.target!
end