Class: A2A::PushNotification::AuthenticationInfo
- Inherits:
-
Object
- Object
- A2A::PushNotification::AuthenticationInfo
- Defined in:
- lib/a2a/push_notification/authentication_info.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Class Method Summary collapse
Instance Method Summary collapse
- #authorization_header ⇒ Object
-
#initialize(scheme:, credentials: nil) ⇒ AuthenticationInfo
constructor
A new instance of AuthenticationInfo.
- #to_h ⇒ Object
Constructor Details
#initialize(scheme:, credentials: nil) ⇒ AuthenticationInfo
Returns a new instance of AuthenticationInfo.
8 9 10 11 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 8 def initialize(scheme:, credentials: nil) @scheme = scheme @credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 6 def credentials @credentials end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
6 7 8 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 6 def scheme @scheme end |
Class Method Details
.from_h(hash) ⇒ Object
13 14 15 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 13 def self.from_h(hash) new(scheme: hash.fetch("scheme"), credentials: hash["credentials"]) end |
Instance Method Details
#authorization_header ⇒ Object
24 25 26 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 24 def credentials ? "#{scheme} #{credentials}" : scheme end |
#to_h ⇒ Object
17 18 19 20 21 22 |
# File 'lib/a2a/push_notification/authentication_info.rb', line 17 def to_h { "scheme" => scheme, "credentials" => credentials }.compact end |