Class: Pennyworth::Presenters::Text

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pennyworth/presenters/text.rb

Overview

Shapes a text record for serialization.

Instance Method Summary collapse

Constructor Details

#initialize(record, inflector: Inflector.new) ⇒ Text

Returns a new instance of Text.



13
14
15
16
# File 'lib/pennyworth/presenters/text.rb', line 13

def initialize record, inflector: Inflector.new
  @record = record
  @inflector = inflector
end

Instance Method Details

#labelObject



18
# File 'lib/pennyworth/presenters/text.rb', line 18

def label = inflector.call(record.content.to_s)