Class: Pennyworth::Serializers::System::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/pennyworth/serializers/system/error.rb

Overview

Serializes a system error into a compatible format for parsing within Alfred script filters.

Instance Method Summary collapse

Constructor Details

#initialize(presenter) ⇒ Error

Returns a new instance of Error.



8
9
10
# File 'lib/pennyworth/serializers/system/error.rb', line 8

def initialize presenter
  @presenter = presenter
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/pennyworth/serializers/system/error.rb', line 12

def to_h
  {
    uid: id,
    title: id,
    subtitle: presenter.subtitle,
    arg: label,
    mods: modifications,
    text: {copy: label, largetype: label}
  }
end