Class: Hitch::Client::Credentials
- Inherits:
-
Object
- Object
- Hitch::Client::Credentials
- Defined in:
- app/models/hitch/client/credentials.rb
Defined Under Namespace
Classes: SerializationForbidden
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(client:, client_secret:) ⇒ Credentials
constructor
A new instance of Credentials.
- #inspect ⇒ Object (also: #to_s)
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(client:, client_secret:) ⇒ Credentials
Returns a new instance of Credentials.
10 11 12 13 14 |
# File 'app/models/hitch/client/credentials.rb', line 10 def initialize(client:, client_secret:) @client = client @client_secret = client_secret.to_s.dup.freeze freeze end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'app/models/hitch/client/credentials.rb', line 8 def client @client end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
8 9 10 |
# File 'app/models/hitch/client/credentials.rb', line 8 def client_secret @client_secret end |
Instance Method Details
#as_json ⇒ Object
26 |
# File 'app/models/hitch/client/credentials.rb', line 26 def as_json(*) = to_h |
#inspect ⇒ Object Also known as: to_s
16 17 18 |
# File 'app/models/hitch/client/credentials.rb', line 16 def inspect %(#<#{self.class.name} client_id=#{client.client_id.inspect} client_secret="[FILTERED]">) end |
#to_h ⇒ Object
22 23 24 |
# File 'app/models/hitch/client/credentials.rb', line 22 def to_h(*) raise SerializationForbidden, "one-time client credentials cannot be serialized" end |
#to_json ⇒ Object
27 |
# File 'app/models/hitch/client/credentials.rb', line 27 def to_json(*) = to_h |