Class: Clickwrap::Integrity::Anchor::Publication
- Inherits:
-
Data
- Object
- Data
- Clickwrap::Integrity::Anchor::Publication
- Defined in:
- lib/clickwrap/integrity/anchor.rb
Overview
What an adapter returns from #publish. anchored: false is a normal
outcome, not an error — a no-op adapter, a provider outage, or a queue
that has not drained yet all mean "not anchored", and the honest record
says so rather than leaving a caller to infer it.
Instance Attribute Summary collapse
-
#anchored ⇒ Object
readonly
Returns the value of attribute anchored.
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
-
#published_at ⇒ Object
readonly
Returns the value of attribute published_at.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
-
#initialize(anchored: false, reference: nil, published_at: nil, provider_name: nil, detail: nil) ⇒ Publication
constructor
A new instance of Publication.
- #to_h ⇒ Object
Constructor Details
#initialize(anchored: false, reference: nil, published_at: nil, provider_name: nil, detail: nil) ⇒ Publication
Returns a new instance of Publication.
44 45 46 |
# File 'lib/clickwrap/integrity/anchor.rb', line 44 def initialize(anchored: false, reference: nil, published_at: nil, provider_name: nil, detail: nil) super end |
Instance Attribute Details
#anchored ⇒ Object (readonly)
Returns the value of attribute anchored
43 44 45 |
# File 'lib/clickwrap/integrity/anchor.rb', line 43 def anchored @anchored end |
#detail ⇒ Object (readonly)
Returns the value of attribute detail
43 44 45 |
# File 'lib/clickwrap/integrity/anchor.rb', line 43 def detail @detail end |
#provider_name ⇒ Object (readonly)
Returns the value of attribute provider_name
43 44 45 |
# File 'lib/clickwrap/integrity/anchor.rb', line 43 def provider_name @provider_name end |
#published_at ⇒ Object (readonly)
Returns the value of attribute published_at
43 44 45 |
# File 'lib/clickwrap/integrity/anchor.rb', line 43 def published_at @published_at end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference
43 44 45 |
# File 'lib/clickwrap/integrity/anchor.rb', line 43 def reference @reference end |
Instance Method Details
#to_h ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/clickwrap/integrity/anchor.rb', line 48 def to_h { "anchored" => anchored, "reference" => reference, "published_at" => published_at && Receipt.format_time(published_at), "provider_name" => provider_name, "detail" => detail }.compact end |