Class: Pennyworth::Serializers::RFC

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

Overview

Serializes a RFC presenter for parsing by Alfred script filters.

Instance Method Summary collapse

Constructor Details

#initialize(presenter) ⇒ RFC

Returns a new instance of RFC.



7
8
9
# File 'lib/pennyworth/serializers/rfc.rb', line 7

def initialize presenter
  @presenter = presenter
end

Instance Method Details

#to_hObject



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

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