lib/crumbs/proxy.rb in crumbs-2.1.2 vs lib/crumbs/proxy.rb in crumbs-4.0.0.0
- old
+ new
@@ -3,16 +3,19 @@
def initialize(&block)
instance_eval &block
end
- %w(
- namespace
- controller
- ).each do |name|
- define_method name do |*args, &block|
- DSL.const_get(name.to_s.classify).new(*args, &block)
- end
+ def namespace(*args, &block)
+ Dsl::Namespace.new *args, &block
+ end
+
+ def controller(*args, &block)
+ Dsl::Controller.new *args, &block
+ end
+
+ def crumb(action, name=nil, &block)
+ Crumbs.definitions.add action, (block_given? ? block : name)
end
end
end