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.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#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:, host:) ⇒ Request
constructor
A new instance of Request.
- #to_hash ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(method:, path:, body:, response:, title:, group:, host:) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 16 17 18 |
# File 'lib/fitting/records/spherical/request.rb', line 10 def initialize(method:, path:, body:, response:, title:, group:, host:) @method = method @path = path @body = body @response = response @title = title @group = group @host = host 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 |
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/fitting/records/spherical/request.rb', line 8 def host @host 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
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fitting/records/spherical/request.rb', line 37 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'], host: hash['host'] ) end |
Instance Method Details
#to_hash ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fitting/records/spherical/request.rb', line 20 def to_hash { method: method, path: path.to_s, body: body, response: response.to_hash, title: title, group: group, host: host } end |
#to_json(*_args) ⇒ Object
32 33 34 |
# File 'lib/fitting/records/spherical/request.rb', line 32 def to_json(*_args) JSON.dump(to_hash) end |