41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/fluent_conditions/accessor_definers.rb', line 41
def define(builder, field)
@options[:values].each do |value|
accessor_method = FluentAccessorMethod.new(value)
builder.class_eval do
define_method(accessor_method.positive_check) do
update_and_continue(instance_variable_get(:@object).send(field) == value)
end
define_method(accessor_method.positive_check_with_result) do
update_and_finish(instance_variable_get(:@object).send(field) == value)
end
define_method(accessor_method.negative_check) do
update_and_continue(instance_variable_get(:@object).send(field) != value)
end
define_method(accessor_method.negative_check_with_result) do
update_and_finish(instance_variable_get(:@object).send(field) != value)
end
end
end
end
|