Class: Pwush::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/pwush/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (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_jsonObject



12
13
14
# File 'lib/pwush/request.rb', line 12

def to_json
  Oj.dump(body)
end