Module: AWS::Flow::Utilities::UpwardLookups Private
- Included in:
- Activities, Options, Workflows
- Defined in:
- lib/aws/decider/utilities.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: InstanceMethods
Instance Attribute Summary collapse
- #precursors ⇒ Object private
Instance Method Summary collapse
- #held_properties ⇒ Object private
- #properties(*args) ⇒ Object private
- #property(name, methods_to_prepare = [lambda(&:to_s)]) ⇒ Object private
Instance Attribute Details
#precursors ⇒ 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.
144 145 146 |
# File 'lib/aws/decider/utilities.rb', line 144 def precursors @precursors end |
Instance Method Details
#held_properties ⇒ 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.
147 148 149 150 151 152 153 |
# File 'lib/aws/decider/utilities.rb', line 147 def held_properties precursors = self.ancestors.dup precursors.delete(self) result = precursors.map{|precursor| precursor.held_properties if precursor.methods.map(&:to_sym).include? :held_properties}.flatten.compact result << @held_properties result.flatten end |
#properties(*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.
174 175 176 |
# File 'lib/aws/decider/utilities.rb', line 174 def properties(*args) args.each { |arg| property(arg) } end |
#property(name, methods_to_prepare = [lambda(&:to_s)]) ⇒ 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.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/aws/decider/utilities.rb', line 156 def property(name, methods_to_prepare = [lambda(&:to_s)]) @held_properties ||= [] @held_properties << name define_method(name) do return_value = instance_variable_get("@#{name}") # Make sure we correctly return false values return_value = (look_upwards(name) || nil) if return_value.nil? return nil if return_value.nil? return_value = "NONE" if return_value == Float::INFINITY methods_to_prepare.each {|method| return_value = method.call(return_value)} return_value end define_method("#{name}=") do |*args| instance_variable_set("@#{name}", args.first) unless args.first.nil? end end |