module AWS::Flow::Utilities::UpwardLookups

@api private

Attributes

precursors[RW]

Public Instance Methods

held_properties() click to toggle source

@api private

# File lib/aws/decider/utilities.rb, line 307
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) click to toggle source

@api private

# File lib/aws/decider/utilities.rb, line 334
def properties(*args)
  args.each { |arg| property(arg) }
end
property(name, methods_to_prepare = [lambda(&:to_s)]) click to toggle source

@api private

# File lib/aws/decider/utilities.rb, line 316
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