Class: Pennyworth::Serializers::Encoding
- Inherits:
-
Object
- Object
- Pennyworth::Serializers::Encoding
- Defined in:
- lib/pennyworth/serializers/encoding.rb
Overview
Serializes an encoding presenter for parsing by Alfred script filters.
Instance Method Summary collapse
-
#initialize(presenter) ⇒ Encoding
constructor
A new instance of Encoding.
- #to_h ⇒ Object
Constructor Details
#initialize(presenter) ⇒ Encoding
Returns a new instance of Encoding.
9 10 11 |
# File 'lib/pennyworth/serializers/encoding.rb', line 9 def initialize presenter @presenter = presenter end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pennyworth/serializers/encoding.rb', line 13 def to_h { uid: presenter.id, title: label, subtitle: %(Aliases: #{aliases.to_sentence}.), arg: label, mods: { alt: {subtitle: "Copy aliases.", arg: aliases.join(", ")} }, text: {copy: label, largetype: label} } end |