Class: MultiAuthSample::OAuthCCGCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_auth_sample/http/auth/o_auth_ccg.rb

Overview

Data class for OAuthCCGCredentials.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil) ⇒ OAuthCCGCredentials

Returns a new instance of OAuthCCGCredentials.

Raises:

  • (ArgumentError)


68
69
70
71
72
73
74
75
# File 'lib/multi_auth_sample/http/auth/o_auth_ccg.rb', line 68

def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil)
  raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil?
  raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil?

  @o_auth_client_id = o_auth_client_id
  @o_auth_client_secret = o_auth_client_secret
  @o_auth_token = o_auth_token
end

Instance Attribute Details

#o_auth_client_idObject (readonly)

Returns the value of attribute o_auth_client_id.



66
67
68
# File 'lib/multi_auth_sample/http/auth/o_auth_ccg.rb', line 66

def o_auth_client_id
  @o_auth_client_id
end

#o_auth_client_secretObject (readonly)

Returns the value of attribute o_auth_client_secret.



66
67
68
# File 'lib/multi_auth_sample/http/auth/o_auth_ccg.rb', line 66

def o_auth_client_secret
  @o_auth_client_secret
end

#o_auth_tokenObject (readonly)

Returns the value of attribute o_auth_token.



66
67
68
# File 'lib/multi_auth_sample/http/auth/o_auth_ccg.rb', line 66

def o_auth_token
  @o_auth_token
end

Instance Method Details

#clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_token: nil) ⇒ Object



77
78
79
80
81
82
83
84
85
86
# File 'lib/multi_auth_sample/http/auth/o_auth_ccg.rb', line 77

def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil,
               o_auth_token: nil)
  o_auth_client_id ||= self.o_auth_client_id
  o_auth_client_secret ||= self.o_auth_client_secret
  o_auth_token ||= self.o_auth_token

  OAuthCCGCredentials.new(o_auth_client_id: o_auth_client_id,
                          o_auth_client_secret: o_auth_client_secret,
                          o_auth_token: o_auth_token)
end