lib/cabbage_doc/request.rb in cabbage_doc-0.0.4 vs lib/cabbage_doc/request.rb in cabbage_doc-0.0.5

- old
+ new

@@ -1,6 +1,7 @@ require 'yaml' +require 'ostruct' require 'digest/sha1' module CabbageDoc class Request METHODS = %i[get post put delete].freeze @@ -9,10 +10,10 @@ class << self def parse(s) variables = YAML.load(s) - new(nil, Collection.instance).tap do |instance| + new(OpenStruct.new(params: {}, env: {}), Collection.instance).tap do |instance| [:@_id, :@_auth, :@_action, :@_method, :@_params].each_with_index do |k, i| instance.instance_variable_set(k, variables[i]) end end end