Class: AWS::SimpleWorkflow::Resource
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::SimpleWorkflow::Resource
- Defined in:
- lib/aws/simple_workflow/resource.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Core::Model
Class Method Summary collapse
Instance Method Summary collapse
-
#exists? ⇒ Boolean
Returns true if the resource exists.
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #initialize, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #initialize, #inspect
Constructor Details
This class inherits a constructor from AWS::Core::Resource
Class Method Details
.attribute(name, options = {}, &block) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/aws/simple_workflow/resource.rb', line 28 def self.attribute name, = {}, &block # the simple workflow attributes are all given as 'lowerCamelCase' # this converts the :snake_case name to the correct format unless [:as] parts = [] name.to_s.split(/_/).each_with_index do |part,n| parts << (n == 0 ? part : part.capitalize) end [:as] = parts.join.to_sym end if [:duration] super(name, ) do translates_output do |v| v.to_s =~ /^\d+$/ ? v.to_i : v.downcase.to_sym end end else super(name, , &block) end end |
Instance Method Details
#exists? ⇒ Boolean
Returns true if the resource exists.
21 22 23 24 25 |
# File 'lib/aws/simple_workflow/resource.rb', line 21 def exists? !!get_resource rescue Errors::UnknownResourceFault false end |