Class: Clerk::Api::Response
- Inherits:
-
Object
- Object
- Clerk::Api::Response
- Defined in:
- lib/clerk/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.
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
#data ⇒ Object
34 35 36 |
# File 'lib/clerk/api.rb', line 34 def data JSON.parse(@res.body, symbolize_names: true) end |