Class: Clerk::Api::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response

Returns a new instance of Response.



30
31
32
# File 'lib/clerk/api.rb', line 30

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



38
39
40
# File 'lib/clerk/api.rb', line 38

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

Instance Method Details

#dataObject



34
35
36
# File 'lib/clerk/api.rb', line 34

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