lib/vedeu/repository/command.rb in vedeu-0.0.14 vs lib/vedeu/repository/command.rb in vedeu-0.0.15
- old
+ new
@@ -27,6 +27,18 @@
def executable
Proc.new { |*args| attributes[:klass].dispatch(*args) }
end
end
+
+ module ClassMethods
+ def command(name, klass, options = {})
+ command_name = name.is_a?(Symbol) ? name.to_s : name
+
+ Command.create({ name: command_name, klass: klass, options: options })
+ end
+ end
+
+ def self.included(receiver)
+ receiver.extend(ClassMethods)
+ end
end