Class: AWS::SimpleWorkflow::TypeCollection

Inherits:
Object
  • Object
show all
Includes:
Core::Collection::Limitable, OptionFormatters
Defined in:
lib/aws/simple_workflow/type_collection.rb

Overview

Instance Attribute Summary collapse

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods included from Core::Collection::Limitable

#each_batch

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.

Parameters:

  • domain (Domain)

    The domain the (workflow or activity types belong to.



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, options = {}

  @domain = domain

  @named = options[:named]

  @registration_status = options[:registration_status] ? 
    options[:registration_status].to_s.upcase : 'REGISTERED'

  @reverse_order = options.key?(:reverse_order) ?
    !!options[:reverse_order] : false

  super

end

Instance Attribute Details

#domainDomain (readonly)

Returns:



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')

Parameters:

  • name (String)

    Name of the type.

  • version (String)

    Version of the type.

Returns:



61
62
63
# File 'lib/aws/simple_workflow/type_collection.rb', line 61

def [] name, version
  member_class.new(domain, name, version)
end

#deprecatedTypeCollection

Returns a collection that will only enumerate deprecated types.

Returns:

  • (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.

Returns:

  • (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

#registerObject Also known as: create

Raises:

  • (NotImplementedError)


66
67
68
# File 'lib/aws/simple_workflow/type_collection.rb', line 66

def register
  raise NotImplementedError # implemented in subclasses
end

#reverse_orderTypeCollection

Returns a collection that enumerates types in reverse alphabetical order. Default ordering is alphabetical.

Returns:

  • (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