Class: Floe::Workflow::IntrinsicFunction
- Inherits:
-
Object
- Object
- Floe::Workflow::IntrinsicFunction
- Defined in:
- lib/floe/workflow/intrinsic_function.rb,
lib/floe/workflow/intrinsic_function/parser.rb,
lib/floe/workflow/intrinsic_function/transformer.rb
Defined Under Namespace
Classes: Parser, Transformer
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payload) ⇒ IntrinsicFunction
constructor
A new instance of IntrinsicFunction.
- #value(context = {}, input = {}) ⇒ Object
Constructor Details
#initialize(payload) ⇒ IntrinsicFunction
Returns a new instance of IntrinsicFunction.
16 17 18 19 20 21 22 23 |
# File 'lib/floe/workflow/intrinsic_function.rb', line 16 def initialize(payload) @payload = payload @tree = Parser.new.parse(payload) Floe.logger.debug { "Parsed intrinsic function: #{payload.inspect} => #{tree.inspect}" } rescue Parslet::ParseFailed => err raise Floe::InvalidWorkflowError, err. end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
14 15 16 |
# File 'lib/floe/workflow/intrinsic_function.rb', line 14 def payload @payload end |
Class Method Details
.intrinsic_function?(payload) ⇒ Boolean
10 11 12 |
# File 'lib/floe/workflow/intrinsic_function.rb', line 10 def self.intrinsic_function?(payload) payload.start_with?("States.") end |
.value(payload, context = {}, input = {}) ⇒ Object
6 7 8 |
# File 'lib/floe/workflow/intrinsic_function.rb', line 6 def self.value(payload, context = {}, input = {}) new(payload).value(context, input) end |
Instance Method Details
#value(context = {}, input = {}) ⇒ Object
25 26 27 |
# File 'lib/floe/workflow/intrinsic_function.rb', line 25 def value(context = {}, input = {}) Transformer.new.apply(tree, :context => context, :input => input) end |