Module: AWS::Flow::Utilities
- Defined in:
- lib/aws/decider/utilities.rb
Overview
Utilities for the AWS Flow Framework for Ruby.
Defined Under Namespace
Modules: SelfMethods, UpwardLookups Classes: AddressableFuture, LogFactory
Class Method Summary collapse
- .drill_on_future(future) ⇒ Object private
- .interpret_block_for_options(option_class, block, use_defaults = false) ⇒ Object private
- .is_external ⇒ Object private
- .merge_all_options(*args) ⇒ Object private
Class Method Details
.drill_on_future(future) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 |
# File 'lib/aws/decider/utilities.rb', line 35 def self.drill_on_future(future) while (future.respond_to? :is_flow_future?) && future.is_flow_future? future = future.get end future end |
.interpret_block_for_options(option_class, block, use_defaults = false) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/aws/decider/utilities.rb', line 53 def self.(option_class, block, use_defaults = false) return option_class.new({}, use_defaults) if block.nil? if block.arity <= 0 result = block.call if result.is_a? Hash = option_class.new(result, use_defaults) else raise "If using 0 arguments to the option configuration, you must return a hash" end else = option_class.new({}, use_defaults) block.call() end if .from_class # Insert into the next-to-last position, as these options should be used excepting where they might conflict with the options specified in the block klass = get_const(.from_class) rescue nil if .precursors.empty? .precursors = klass. else .precursors.insert(-2, klass.).flatten! end .prefix_name ||= .from_class end end |
.is_external ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
106 107 108 109 110 111 112 113 |
# File 'lib/aws/decider/utilities.rb', line 106 def self.is_external if (defined? Fiber).nil? return true elsif FlowFiber.current != nil && FlowFiber.current.class != Fiber && FlowFiber.current[:decision_context] != nil return false end return true end |
.merge_all_options(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 46 47 48 49 |
# File 'lib/aws/decider/utilities.rb', line 43 def self.(*args) args.compact! youngest = args.last args.delete(youngest) youngest.precursors.concat(args.reverse) youngest. end |