Class: LogAuditor::Parser
- Inherits:
-
Object
- Object
- LogAuditor::Parser
- Defined in:
- lib/log_auditor/parser.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
Instance Method Summary collapse
-
#initialize(reader:, formatter:, presenter:) ⇒ Parser
constructor
A new instance of Parser.
- #parse! ⇒ Object
Constructor Details
#initialize(reader:, formatter:, presenter:) ⇒ Parser
Returns a new instance of Parser.
6 7 8 9 10 |
# File 'lib/log_auditor/parser.rb', line 6 def initialize(reader:, formatter:, presenter:) @reader = reader @formatter = formatter @presenter = presenter end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
4 5 6 |
# File 'lib/log_auditor/parser.rb', line 4 def formatter @formatter end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
4 5 6 |
# File 'lib/log_auditor/parser.rb', line 4 def presenter @presenter end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
4 5 6 |
# File 'lib/log_auditor/parser.rb', line 4 def reader @reader end |
Instance Method Details
#parse! ⇒ Object
12 13 14 15 16 |
# File 'lib/log_auditor/parser.rb', line 12 def parse! raw_data = reader.read! formatted_data = formatter.new(raw_data).format! presenter.new(formatted_data).present! end |