Class: MetOnTheMiddle::Senders::FileSystem

Inherits:
Base
  • Object
show all
Defined in:
lib/met_on_the_middle/senders/file_system.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileSystem

Returns a new instance of FileSystem.



6
7
8
# File 'lib/met_on_the_middle/senders/file_system.rb', line 6

def initialize(path)
  self.logger = ::Logger.new(path, 2)
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



4
5
6
# File 'lib/met_on_the_middle/senders/file_system.rb', line 4

def logger
  @logger
end

Instance Method Details

#write(request) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/met_on_the_middle/senders/file_system.rb', line 11

def write(request)
  self.logger.info request.time.to_s do
    keys = []
    request.data.each do |k, v|
      keys<<"#{k}:#{v}"
    end
    keys.join("|")
  end
end