Class: Pwush::Request
- Inherits:
-
Object
- Object
- Pwush::Request
- Defined in:
- lib/pwush/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(auth:, app:, payload: nil) ⇒ Request
constructor
A new instance of Request.
- #to_json ⇒ Object
Constructor Details
#initialize(auth:, app:, payload: nil) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 10 |
# File 'lib/pwush/request.rb', line 5 def initialize(auth:, app:, payload: nil) @auth = auth @app = app @payload = payload || {} @body = build_body(@payload) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/pwush/request.rb', line 3 def body @body end |
Instance Method Details
#to_json ⇒ Object
12 13 14 |
# File 'lib/pwush/request.rb', line 12 def to_json Oj.dump(body) end |