Class: PusherPlatform::AuthenticationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/pusher-platform/authentication_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ AuthenticationResponse

Returns a new instance of AuthenticationResponse.



5
6
7
8
9
# File 'lib/pusher-platform/authentication_response.rb', line 5

def initialize(options)
  @status = options[:status]
  @headers = options[:headers] || {}
  @body = options[:body]
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/pusher-platform/authentication_response.rb', line 3

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/pusher-platform/authentication_response.rb', line 3

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/pusher-platform/authentication_response.rb', line 3

def status
  @status
end

Instance Method Details

#as_json(options = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/pusher-platform/authentication_response.rb', line 15

def as_json(options = {})
  {
    status: @status,
    headers: @headers,
    body: @body
  }
end

#to_json(*options) ⇒ Object



23
24
25
# File 'lib/pusher-platform/authentication_response.rb', line 23

def to_json(*options)
  as_json(*options).to_json(*options)
end

#to_sObject



11
12
13
# File 'lib/pusher-platform/authentication_response.rb', line 11

def to_s
  "PusherPlatform::AuthenticationResponse - status: #{@status} body: #{@body.to_json}"
end