Class: Pennyworth::Serializers::HTTPStatus
- Inherits:
-
Object
- Object
- Pennyworth::Serializers::HTTPStatus
- Defined in:
- lib/pennyworth/serializers/http_status.rb
Overview
Serializes a HTTP status presenter for parsing by Alfred script filters.
Instance Method Summary collapse
-
#initialize(presenter) ⇒ HTTPStatus
constructor
A new instance of HTTPStatus.
- #to_h ⇒ Object
Constructor Details
#initialize(presenter) ⇒ HTTPStatus
Returns a new instance of HTTPStatus.
7 8 9 |
# File 'lib/pennyworth/serializers/http_status.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/http_status.rb', line 11 def to_h { uid: id, title: code, subtitle: label, arg: presenter.symbol, mods: modifications, text: {copy: "#{code} #{label}", largetype: "#{code} #{label}"} } end |