Class: Postmortem::Adapters::Base
- Inherits:
-
Object
- Object
- Postmortem::Adapters::Base
- Defined in:
- lib/postmortem/adapters/base.rb
Overview
Base interface implementation for all Postmortem adapters.
Direct Known Subclasses
Instance Method Summary collapse
- #html_body ⇒ Object
- #html_body=(val) ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #serializable ⇒ Object
- #text_body ⇒ Object
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/postmortem/adapters/base.rb', line 9 def initialize(data) @data = data @adapted = adapted end |
Instance Method Details
#html_body ⇒ Object
32 33 34 |
# File 'lib/postmortem/adapters/base.rb', line 32 def html_body @adapted[:html_body].to_s end |
#html_body=(val) ⇒ Object
14 15 16 |
# File 'lib/postmortem/adapters/base.rb', line 14 def html_body=(val) @adapted[:html_body] = val end |
#id ⇒ Object
22 23 24 |
# File 'lib/postmortem/adapters/base.rb', line 22 def id @id ||= SecureRandom.uuid end |
#serializable ⇒ Object
18 19 20 |
# File 'lib/postmortem/adapters/base.rb', line 18 def serializable (%i[id] + FIELDS).to_h { |field| [camelize(field.to_s), public_send(field)] } end |
#text_body ⇒ Object
36 37 38 |
# File 'lib/postmortem/adapters/base.rb', line 36 def text_body @adapted[:text_body].to_s end |