Class: Pennyworth::Presenters::HTTPStatus
- Inherits:
-
Object
- Object
- Pennyworth::Presenters::HTTPStatus
- Extended by:
- Forwardable
- Defined in:
- lib/pennyworth/presenters/http_status.rb
Overview
Shapes a HTTP status record for serialization.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(record, inflector: Inflector.new) ⇒ HTTPStatus
constructor
A new instance of HTTPStatus.
- #subtitle ⇒ Object
- #symbol ⇒ Object
Constructor Details
#initialize(record, inflector: Inflector.new) ⇒ HTTPStatus
Returns a new instance of HTTPStatus.
16 17 18 19 |
# File 'lib/pennyworth/presenters/http_status.rb', line 16 def initialize record, inflector: Inflector.new @record = record @inflector = inflector end |
Instance Method Details
#id ⇒ Object
21 |
# File 'lib/pennyworth/presenters/http_status.rb', line 21 def id = record.code |
#subtitle ⇒ Object
23 |
# File 'lib/pennyworth/presenters/http_status.rb', line 23 def subtitle = "#{id} #{label}" |
#symbol ⇒ Object
25 |
# File 'lib/pennyworth/presenters/http_status.rb', line 25 def symbol = ":#{inflector.call name}" |