Class: Clerk::ApiResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/clerk-rails.rb

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ ApiResponse

Returns a new instance of ApiResponse.



67
68
69
# File 'lib/clerk-rails.rb', line 67

def initialize(faraday_response)
  @res = faraday_response
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



75
76
77
# File 'lib/clerk-rails.rb', line 75

def method_missing(m, *args, &block)
  @res.send(m, *args, &block)
end

Instance Method Details

#dataObject



71
72
73
# File 'lib/clerk-rails.rb', line 71

def data
  JSON.parse(@res.body, symbolize_names: true)
end