Class: Pennyworth::Serializers::Project

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(presenter) ⇒ Project

Returns a new instance of Project.



7
8
9
# File 'lib/pennyworth/serializers/project.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/project.rb', line 11

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