Class: OmgPullRequest::TestLogger
- Inherits:
-
Object
- Object
- OmgPullRequest::TestLogger
- Defined in:
- lib/omg_pull_request/test_logger.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
Returns the value of attribute buffer.
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ TestLogger
constructor
A new instance of TestLogger.
- #log(output) ⇒ Object
- #store_logs!(file_name) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ TestLogger
Returns a new instance of TestLogger.
4 5 6 7 8 |
# File 'lib/omg_pull_request/test_logger.rb', line 4 def initialize(attributes={}) attributes.each do |attr, value| self.send("#{attr}=", value) end end |
Instance Attribute Details
#buffer ⇒ Object
Returns the value of attribute buffer.
3 4 5 |
# File 'lib/omg_pull_request/test_logger.rb', line 3 def buffer @buffer end |
#store ⇒ Object
Returns the value of attribute store.
3 4 5 |
# File 'lib/omg_pull_request/test_logger.rb', line 3 def store @store end |
Instance Method Details
#log(output) ⇒ Object
10 11 12 13 |
# File 'lib/omg_pull_request/test_logger.rb', line 10 def log(output) puts output self.buffer = "#{buffer}\n#{output}" end |
#store_logs!(file_name) ⇒ Object
15 16 17 |
# File 'lib/omg_pull_request/test_logger.rb', line 15 def store_logs!(file_name) self.store.store(StringIO.new(buffer), file_name) end |