spec/trigger_spec.rb in moosex-0.0.18 vs spec/trigger_spec.rb in moosex-0.0.19
- old
+ new
@@ -17,19 +17,19 @@
trigger: :my_method,
}
has attr_with_default: {
is: :rw,
- trigger: lambda do |object, new_value|
- object.logger.log "will update attr_with_trigger with new value #{new_value}"
+ trigger: ->(this, new_value) do
+ this.logger.log "will update attr_with_trigger with new value #{new_value}"
end,
default: 1,
}
has attr_lazy_trigger: {
is: :lazy,
trigger: :my_method,
- builder: lambda{ |x| 1},
+ builder: ->(this) { 1 },
}
def my_method(new_value)
logger.log "will update attr_with_trigger with new value #{new_value}"
end