lib/surrounded/context/trigger_controls.rb in surrounded-0.9.0 vs lib/surrounded/context/trigger_controls.rb in surrounded-0.9.1
- old
+ new
@@ -35,11 +35,11 @@
convert_method_to_trigger(name)
end
else
name = names.first
define_trigger_action(*names, &block)
- define_trigger(name, &block)
+ define_trigger(name)
store_trigger(name)
end
end
def convert_method_to_trigger(name)
@@ -51,12 +51,11 @@
store_trigger(name)
end
end
def define_trigger(name)
- line = __LINE__
- self.class_eval %{
+ line = __LINE__; self.class_eval %{
def #{name}(*args, &block)
begin
apply_behaviors
#{trigger_return_content(name)}
@@ -76,12 +75,10 @@
end
end
def define_trigger_action(*name_and_args, &block)
- trigger_action_module.module_eval do
- define_method(*name_and_args, &block)
- end
+ trigger_action_module.send(:define_method, *name_and_args, &block)
end
def trigger_action_module
self.const_get('TriggerMethods', false)
end
\ No newline at end of file