«
Support for various types of ruby variables
rule 'set variable' do
on_start
run { @foo = 'bar' }
run { logger.info("@Foo is #{@foo}") }
end
rule 'set variable' do
on_start
run do
rule_var { @foo = 'bar' }
logger.info("@Foo set to #{ rule_var { @foo } }")
end
end
rule 'read variable' do
on_start
delay 2.seconds
run do
logger.info("@Foo is defined: #{ rule_var { instance_variable_defined?("@foo")} }")
end
end
rule 'set variable' do
on_start
run do
rule_var { @foo = 'bar' }
logger.info("#{rule_var{self.class.name}}")
logger.info("#{rule_var{object_id}}")
logger.info("@Foo set to #{ rule_var { @foo } }")
end
end
rule 'read variable' do
on_start
delay 2.seconds
run do
logger.info("#{rule_var{self.class.name}}")
logger.info("#{rule_var{object_id}}")
logger.info("@Foo is defined: #{ rule_var { instance_variable_defined?("@foo")} }")
end
end