Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Remove Nexmo::Namespace.response_class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
timcraft committed Mar 23, 2020
1 parent 0f33541 commit a7cb23a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/nexmo/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,14 @@ def self.request_headers
@request_headers ||= {}
end

def self.response_class
@response_class ||= Response
end

def self.response_class=(response_class)
@response_class = response_class
end

protected

Get = Net::HTTP::Get
Put = Net::HTTP::Put
Post = Net::HTTP::Post
Delete = Net::HTTP::Delete

def request(path, params: nil, type: Get, response_class: nil, &block)
def request(path, params: nil, type: Get, response_class: Response, &block)
uri = URI('https://' + @host + path)

params ||= {}
Expand Down Expand Up @@ -97,7 +89,7 @@ def request(path, params: nil, type: Get, response_class: nil, &block)

logger.debug(response.body) if response.body

parse(response, response_class || self.class.response_class)
parse(response, response_class)
end

def parse(response, response_class)
Expand Down

0 comments on commit a7cb23a

Please sign in to comment.