Class: Pennyworth::Serializers::Text
- Inherits:
-
Object
- Object
- Pennyworth::Serializers::Text
- Defined in:
- lib/pennyworth/serializers/text.rb
Overview
Serializes a text presenter for parsing by Alfred script filters.
Instance Method Summary collapse
-
#initialize(presenter) ⇒ Text
constructor
A new instance of Text.
- #to_h ⇒ Object
Constructor Details
#initialize(presenter) ⇒ Text
Returns a new instance of Text.
7 8 9 |
# File 'lib/pennyworth/serializers/text.rb', line 7 def initialize presenter @presenter = presenter end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pennyworth/serializers/text.rb', line 11 def to_h { uid: id, title: presenter.label, subtitle: id.capitalize, arg: content, icon: {path: "text/#{id}.png"}, text: {copy: content, largetype: content} } end |