lib/sinatra/rabbit/features.rb in sinatra-rabbit-1.0.3 vs lib/sinatra/rabbit/features.rb in sinatra-rabbit-1.0.5

- old
+ new

@@ -52,10 +52,20 @@ def initialize(name, &block) @name = name @params = block end + def params_array + @p_arr = [] + instance_eval(&self.params) + @p_arr + end + + def param(*args) + @p_arr << Rabbit::Param.new(*args) + end + end end module Features @@ -76,10 +86,10 @@ end @features.find { |f| f.name == name } end def self.included(base) - base.register(Features) + base.register(Features) if base.respond_to? :register end end end