Class: Clickwrap::Integrity::Timestamp::Token
- Inherits:
-
Data
- Object
- Data
- Clickwrap::Integrity::Timestamp::Token
- Defined in:
- lib/clickwrap/integrity/timestamp.rb
Overview
What an adapter returns from #timestamp. issued: false is an
ordinary outcome — no provider configured, provider unavailable, request
declined — and the record says which rather than leaving a gap where a
token should be.
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#digest ⇒ Object
readonly
Returns the value of attribute digest.
-
#issued ⇒ Object
readonly
Returns the value of attribute issued.
-
#issued_at ⇒ Object
readonly
Returns the value of attribute issued_at.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(issued: false, token: nil, digest: nil, provider_name: nil, protocol: nil, issued_at: nil, detail: nil) ⇒ Token
constructor
A new instance of Token.
- #to_h ⇒ Object
Constructor Details
#initialize(issued: false, token: nil, digest: nil, provider_name: nil, protocol: nil, issued_at: nil, detail: nil) ⇒ Token
Returns a new instance of Token.
49 50 51 52 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 49 def initialize(issued: false, token: nil, digest: nil, provider_name: nil, protocol: nil, issued_at: nil, detail: nil) super end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def detail @detail end |
#digest ⇒ Object (readonly)
Returns the value of attribute digest
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def digest @digest end |
#issued ⇒ Object (readonly)
Returns the value of attribute issued
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def issued @issued end |
#issued_at ⇒ Object (readonly)
Returns the value of attribute issued_at
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def issued_at @issued_at end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def protocol @protocol end |
#provider_name ⇒ Object (readonly)
Returns the value of attribute provider_name
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def provider_name @provider_name end |
#token ⇒ Object (readonly)
Returns the value of attribute token
48 49 50 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 48 def token @token end |
Instance Method Details
#to_h ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/clickwrap/integrity/timestamp.rb', line 54 def to_h { "issued" => issued, "token" => token, "digest" => digest, "provider_name" => provider_name, "protocol" => protocol, # The provider's own time, described as the provider's own time. "provider_reported_time" => issued_at && Receipt.format_time(issued_at), "detail" => detail }.compact end |