Class: ClerkRails::Api::Response
- Inherits:
-
Object
- Object
- ClerkRails::Api::Response
- Defined in:
- lib/clerk_rails/api.rb
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(faraday_response) ⇒ Response
constructor
A new instance of Response.
- #method_missing(m, *args, &block) ⇒ Object
Constructor Details
#initialize(faraday_response) ⇒ Response
Returns a new instance of Response.
31 32 33 |
# File 'lib/clerk_rails/api.rb', line 31 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
39 40 41 |
# File 'lib/clerk_rails/api.rb', line 39 def method_missing(m, *args, &block) @res.send(m, *args, &block) end |
Instance Method Details
#data ⇒ Object
35 36 37 |
# File 'lib/clerk_rails/api.rb', line 35 def data JSON.parse(@res.body, symbolize_names: true) end |