lib/dpd_api/nl.rb in dpd_api-0.0.1 vs lib/dpd_api/nl.rb in dpd_api-0.1.0
- old
+ new
@@ -1,26 +1,15 @@
+# encoding: utf-8
+
module DpdApi
class Nl < Base
- # TODO: Implement namespace
class << self
- def get_nl_amount(params = {})
- method = :get_nl_amount
- namespace = :arg0
- response(method, params, namespace: namespace)
+ def nl_amount(params = {})
+ response(:get_nl_amount, params, namespace: :arg0)
end
- def get_nl_invoice(params = {})
- method = :get_nl_invoice
- namespace = :arg0
- response(method, params, namespace: namespace)
- end
-
- def response(method, params = {}, namespace: nil)
- params = @auth_params.clone.deep_merge!(params)
- request = namespace ? { namespace => params } : params
- response = @client.call(method, message: request)
- namespace = "#{method}_response".to_sym
- response.body[namespace][:return]
+ def nl_invoice(params = {})
+ response(:get_nl_invoice, params, namespace: :arg0)
end
protected
def url