lib/apitizer/base.rb in apitizer-0.0.2 vs lib/apitizer/base.rb in apitizer-0.0.3

- old
+ new

@@ -2,11 +2,11 @@ class Base extend Forwardable def_delegator :map, :define - def initialize(**options, &block) + def initialize(options = {}, &block) @options = Helper.deep_merge(Apitizer.defaults, options) @block = block end def process(*arguments) @@ -39,10 +39,10 @@ end def prepare(action, *path) action = action.to_sym method = @options[:dictionary][action] or raise Error, 'Unknown action' - parameters = path.last.is_a?(Hash) ? path.pop : {} + parameters = Helper.extract_hash!(path) steps = path.flatten.map(&:to_sym) [ action, method, steps, parameters ] end end