class AWS::SimpleWorkflow::Resource

@private

Public Class Methods

attribute(name, options = {}) click to toggle source

@private

Calls superclass method AWS::Core::Resource::attribute
# File lib/aws/simple_workflow/resource.rb, line 28
def self.attribute name, options = {}, &block

  # the simple workflow attributes are all given as 'lowerCamelCase'
  # this converts the :snake_case name to the correct format
  unless options[:from]
    parts = []
    name.to_s.split(/_/).each_with_index do |part,n|
      parts << (n == 0 ? part : part.capitalize)
    end
    options[:from] = parts.join.to_sym
  end

  if options[:duration]
    super(name, options) do
      translates_output do |v| 
        v.to_s =~ /^\d+$/ ? v.to_i : v.downcase.to_sym
      end
    end
  else
    super(name, options, &block)
  end

end

Protected Class Methods

config_attribute(name, options = {}) click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 81
def self.config_attribute name, options = {}, &block
  attr = attribute(name, options.merge(:static => true), &block)
  config_attributes[attr.name] = attr
end
config_attributes() click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 64
def self.config_attributes
  @config_attributes ||= {}
end
info_attribute(name, options = {}) click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 87
def self.info_attribute name, options = {}
  attr = attribute(name, options)
  info_attributes[attr.name] = attr
end
info_attributes() click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 69
def self.info_attributes
  @info_attributes ||= {}
end
type_attribute(name, options = {}) click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 74
def self.type_attribute name, options = {}, &block
  options[:static] = true unless options.has_key?(:static)
  attr = attribute(name, options, &block)
  type_attributes[attr.name] = attr
end
type_attributes() click to toggle source

@private

# File lib/aws/simple_workflow/resource.rb, line 59
def self.type_attributes
  @type_attributes ||= {}
end

Public Instance Methods

exists?() click to toggle source

@return [Boolean] Returns true if the resource exists.

# File lib/aws/simple_workflow/resource.rb, line 21
def exists?
  !!get_resource
rescue Errors::UnknownResourceFault
  false
end

Protected Instance Methods

get_resource(attr_name = nil) click to toggle source
# File lib/aws/simple_workflow/resource.rb, line 53
def get_resource attr_name = nil
  method = "describe_#{Core::Inflection.ruby_name(self.class.name)}"
  client.send(method, resource_options)
end