lib/nds_api.rb in nds_api-0.1.9 vs lib/nds_api.rb in nds_api-0.1.11
- old
+ new
@@ -1,10 +1,10 @@
-require "nds_api/http"
-require "nds_api/method"
-require "nds_api/url"
-require "nds_api/utils"
-require "nds_api/version"
+require 'nds_api/http'
+require 'nds_api/method'
+require 'nds_api/url'
+require 'nds_api/utils'
+require 'nds_api/version'
module NdsApi
class Client
# Create a new client instance
#
@@ -28,12 +28,12 @@
NdsApi::Utils.hash_keys_str_to_sym(response)
end
private
- def http_action(method, *args, &block)
- if @method.is_create? or @method.is_search?
+ def http_action(method, *args)
+ if @method.is_create? || @method.is_search?
@http.post(url, data)
elsif @method.is_update?
@http.put(url, data)
else
@http.get(@url.send(method, *args))
@@ -43,10 +43,10 @@
def data
@args.include?(:data) ? @args[:data] : @args.first
end
def url
- if @method.is_search? and query_params
+ if @method.is_search? && query_params
@url.send(@method.action, query_params)
else
@url.send(@method.action)
end
end