Class: Gm::Notepad::Pad
- Inherits:
-
Object
- Object
- Gm::Notepad::Pad
- Defined in:
- lib/gm/notepad/pad.rb
Overview
Responsible for recording entries and then dumping them accordingly.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#table_registry ⇒ Object
readonly
Returns the value of attribute table_registry.
Instance Method Summary collapse
- #close! ⇒ Object
-
#initialize(**config) ⇒ Pad
constructor
A new instance of Pad.
- #process(input:) ⇒ Object
Constructor Details
#initialize(**config) ⇒ Pad
Returns a new instance of Pad.
6 7 8 9 10 11 12 |
# File 'lib/gm/notepad/pad.rb', line 6 def initialize(**config) self.config = config self.table_registry = config.fetch(:table_registry) { default_table_registry } self.renderer = config.fetch(:renderer) { default_renderer } self.input_processor = config.fetch(:input_processor) { default_input_processor } open! end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/gm/notepad/pad.rb', line 5 def config @config end |
#table_registry ⇒ Object
Returns the value of attribute table_registry.
24 25 26 |
# File 'lib/gm/notepad/pad.rb', line 24 def table_registry @table_registry end |
Instance Method Details
#close! ⇒ Object
20 21 22 |
# File 'lib/gm/notepad/pad.rb', line 20 def close! @renderer.close! end |
#process(input:) ⇒ Object
14 15 16 17 18 |
# File 'lib/gm/notepad/pad.rb', line 14 def process(input:) input_processor.process(input: input) do |*args| renderer.call(*args) end end |