Permalink
Browse files

Update lib/timeline_fu/fires.rb

  • Loading branch information...
1 parent 77bdaf3 commit e77ad3ce2083e3f0ef0489be25730e9adc601a0f @volodymyr-vasylyshyn committed Dec 19, 2011
Showing with 6 additions and 10 deletions.
  1. +6 −10 lib/timeline_fu/fires.rb
View
@@ -12,11 +12,7 @@ def fires(event_type, opts)
if opts[:on].kind_of?(Array)
opts[:on].each { |on| fires(event_type, opts.merge({:on => on})) }
return
- end
- if opts[:actor].kind_of?(Array)
- opts[:actor].each { |actor| fires(event_type, opts.merge({:actor => actor})) }
- return
- end
+ end
opts[:subject] = :self unless opts.has_key?(:subject)
@@ -29,13 +25,13 @@ def fires(event_type, opts)
new_opts = opts.merge({:actor => actor})
create_options = [:actor, :subject, :secondary_subject].inject({}) do |memo, sym|
- if new_opts[sym]
- if new_opts[sym].respond_to?(:call)
- memo[sym] = new_opts[sym].call(self)
- elsif new_opts[sym] == :self
+ if opts[sym]
+ if opts[sym].respond_to?(:call)
+ memo[sym] = opts[sym].call(self)
+ elsif opts[sym] == :self
memo[sym] = self
else
- memo[sym] = send(new_opts[sym])
+ memo[sym] = send(opts[sym])
end
end
memo

0 comments on commit e77ad3c

Please sign in to comment.