Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow manually defining `#action`.

  • Loading branch information...
commit bce6e582b01caa6bfc238303b783ae5c15417fb0 1 parent f9d8fec
@jneen jneen authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/imperator/command.rb
View
8 lib/imperator/command.rb
@@ -15,7 +15,7 @@ class << self
end
def self.action(&block)
- define_method(:raw_perform, &block)
+ define_method(:action, &block)
end
alias_method :params, :attributes
@@ -62,12 +62,12 @@ def perform!
end
# @abstract
- def raw_perform
- raise "You need to define the perform block for #{self.class.name}"
+ def action
+ raise NoMethodError.new("Please define #action for #{self.class.name}")
end
def perform
- run_callbacks(:perform) { raw_perform }
+ run_callbacks(:perform) { action }
end
def method_missing(method, *args)

0 comments on commit bce6e58

Please sign in to comment.
Something went wrong with that request. Please try again.