Class: Qravan::Response
- Inherits:
-
Object
- Object
- Qravan::Response
- Defined in:
- lib/qravan/query/response.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#request ⇒ Object
Returns the value of attribute request.
-
#resources ⇒ Object
Returns the value of attribute resources.
Instance Method Summary collapse
- #answer ⇒ Object
-
#initialize(request) ⇒ Response
constructor
A new instance of Response.
- #validate ⇒ Object
Constructor Details
#initialize(request) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 |
# File 'lib/qravan/query/response.rb', line 9 def initialize(request) @request ||= request @resources = request.resources @credentials = request.credentials end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
7 8 9 |
# File 'lib/qravan/query/response.rb', line 7 def credentials @credentials end |
#request ⇒ Object
Returns the value of attribute request.
5 6 7 |
# File 'lib/qravan/query/response.rb', line 5 def request @request end |
#resources ⇒ Object
Returns the value of attribute resources.
6 7 8 |
# File 'lib/qravan/query/response.rb', line 6 def resources @resources end |
Instance Method Details
#answer ⇒ Object
19 20 21 22 23 24 |
# File 'lib/qravan/query/response.rb', line 19 def answer { "response": @resources, "credentials": Qravan::Credentials::Query.new(@credentials).credentials }.to_json end |
#validate ⇒ Object
15 16 17 |
# File 'lib/qravan/query/response.rb', line 15 def validate @request end |