Class: ListingIssues::Issue
- Inherits:
-
Data
- Object
- Data
- ListingIssues::Issue
- Defined in:
- app/services/listing_issues/issue.rb
Overview
Normalized, transient representation of one listing problem produced by a
provider adapter and consumed by Sync. Not persisted — it's
the shape the sync upserts into a ListingIssue row.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#fingerprint ⇒ Object
readonly
Returns the value of attribute fingerprint.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(provider:, code:, severity: 'error', title: nil, message: nil, details: {}, fingerprint: nil) ⇒ Issue
constructor
A new instance of Issue.
Constructor Details
#initialize(provider:, code:, severity: 'error', title: nil, message: nil, details: {}, fingerprint: nil) ⇒ Issue
Returns a new instance of Issue.
19 20 21 22 23 24 |
# File 'app/services/listing_issues/issue.rb', line 19 def initialize(provider:, code:, severity: 'error', title: nil, message: nil, details: {}, fingerprint: nil) provider = provider.to_s code = code.to_s fingerprint ||= Digest::SHA1.hexdigest([provider, code, ].join('|')) super(provider:, code:, severity: severity.to_s, title:, message:, details: details || {}, fingerprint:) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def details @details end |
#fingerprint ⇒ Object (readonly)
Returns the value of attribute fingerprint
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def fingerprint @fingerprint end |
#message ⇒ Object (readonly)
Returns the value of attribute message
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def @message end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def provider @provider end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def severity @severity end |
#title ⇒ Object (readonly)
Returns the value of attribute title
10 11 12 |
# File 'app/services/listing_issues/issue.rb', line 10 def title @title end |