summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo <mo@mokhan.ca>2018-05-07 14:45:08 -0600
committermo <mo@mokhan.ca>2018-05-07 14:45:08 -0600
commitf66d272a243508ba665996a0c6cc78fcf23cb046 (patch)
tree8f3de1553a6c35652d78e2c3229da42f36f693b9 /lib
parent7bd5698c3fe2d56dad04db0a6ee9d685673d4a3d (diff)
extract mapper method.
Diffstat (limited to 'lib')
-rw-r--r--lib/net/hippie/client.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb
index 5aeef9a..d36de5d 100644
--- a/lib/net/hippie/client.rb
+++ b/lib/net/hippie/client.rb
@@ -63,9 +63,13 @@ module Net
def request_for(type, uri, headers: {}, body: {})
type.new(uri, default_headers.merge(headers)).tap do |x|
- x.body = JSON.generate(body) unless body.empty?
+ x.body = map_from(body) unless body.empty?
end
end
+
+ def map_from(hash)
+ JSON.generate(hash)
+ end
end
end
end