Class: Fitting::Records::Spherical::Request
- Inherits:
-
Object
- Object
- Fitting::Records::Spherical::Request
- Defined in:
- lib/fitting/records/spherical/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(method:, path:, body:, response:, title:, group:) ⇒ Request
constructor
A new instance of Request.
- #to_hash ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(method:, path:, body:, response:, title:, group:) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 16 17 |
# File 'lib/fitting/records/spherical/request.rb', line 10 def initialize(method:, path:, body:, response:, title:, group:) @method = method @path = path @body = body @response = response @title = title @group = group end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def body @body end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def group @group end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def path @path end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def response @response end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def title @title end |
Class Method Details
.load(hash) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fitting/records/spherical/request.rb', line 35 def load(hash) new( method: hash['method'], path: hash['path'], body: hash['body'], response: Fitting::Records::Spherical::Response.load(hash['response']), title: hash['title'], group: hash['group'] ) end |
Instance Method Details
#to_hash ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fitting/records/spherical/request.rb', line 19 def to_hash { method: method, path: path.to_s, body: body, response: response.to_hash, title: title, group: group } end |
#to_json(*_args) ⇒ Object
30 31 32 |
# File 'lib/fitting/records/spherical/request.rb', line 30 def to_json(*_args) JSON.dump(to_hash) end |