Class: AWS::SimpleWorkflow::TypeCollection
- Inherits:
-
Object
- Object
- AWS::SimpleWorkflow::TypeCollection
- Includes:
- Core::Collection::Limitable, OptionFormatters
- Defined in:
- lib/aws/simple_workflow/type_collection.rb
Overview
The base class for WorkflowTypeCollection and ActivityTypeCollection.
Direct Known Subclasses
Instance Attribute Summary collapse
- #domain ⇒ Domain readonly
Attributes included from Core::Model
Instance Method Summary collapse
-
#[](name, version) ⇒ ActivityType, WorkflowType
(also: #at)
Returns the type with the given name and version.
-
#deprecated ⇒ TypeCollection
Returns a collection that will only enumerate deprecated types.
-
#initialize(domain, options = {}) ⇒ TypeCollection
constructor
A new instance of TypeCollection.
-
#named(name) ⇒ TypeCollection
Returns a collection that enumerates types with the given name.
- #register ⇒ Object (also: #create)
-
#reverse_order ⇒ TypeCollection
Returns a collection that enumerates types in reverse alphabetical order.
Methods included from Core::Collection::Limitable
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(domain, options = {}) ⇒ TypeCollection
Returns a new instance of TypeCollection.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 26 def initialize domain, = {} @domain = domain @named = [:named] @registration_status = [:registration_status] ? [:registration_status].to_s.upcase : 'REGISTERED' @reverse_order = .key?(:reverse_order) ? !![:reverse_order] : false super end |
Instance Attribute Details
#domain ⇒ Domain (readonly)
43 44 45 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 43 def domain @domain end |
Instance Method Details
#[](name, version) ⇒ ActivityType, WorkflowType Also known as: at
Returns the type with the given name and version.
# get a workflow type
domain.workflow_types['name','version']
domain.workflow_types.at('name','version')
# get an activity type
domain.activity_types['name','version']
domain.activity_types.at('name','version')
61 62 63 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 61 def [] name, version member_class.new(domain, name, version) end |
#deprecated ⇒ TypeCollection
Returns a collection that will only enumerate deprecated types.
73 74 75 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 73 def deprecated collection_with(:registration_status => 'DEPRECATED') end |
#named(name) ⇒ TypeCollection
Returns a collection that enumerates types with the given name. Each instance will have a different version.
87 88 89 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 87 def named name collection_with(:named => name.to_s) end |
#register ⇒ Object Also known as: create
66 67 68 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 66 def register raise NotImplementedError # implemented in subclasses end |
#reverse_order ⇒ TypeCollection
Returns a collection that enumerates types in reverse alphabetical order. Default ordering is alphabetical.
80 81 82 |
# File 'lib/aws/simple_workflow/type_collection.rb', line 80 def reverse_order collection_with(:reverse_order => true) end |