lib/sanford-protocol/request.rb in sanford-protocol-0.6.0 vs lib/sanford-protocol/request.rb in sanford-protocol-0.7.0
- old
+ new
@@ -15,11 +15,11 @@
attr_reader :name, :params
def initialize(name, params)
self.validate!(name, params)
- @name, @params = name, params
+ @name, @params = name.to_s, params
end
def to_hash
{ 'name' => name,
'params' => self.stringify(params)
@@ -38,10 +38,10 @@
protected
def validate!(name, params)
problem = if !name
"The request doesn't contain a name."
- elsif !params.kind_of?(Hash)
+ elsif !params.kind_of?(::Hash)
"The request's params are not a valid BSON document."
end
raise(BadRequestError, problem) if problem
end