Class: BetfairApiNgRails::Api::Logs::FileLogger

Inherits:
Struct
  • Object
show all
Defined in:
lib/betfair_api_ng_rails/api/logs/file_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



4
5
6
# File 'lib/betfair_api_ng_rails/api/logs/file_logger.rb', line 4

def env
  @env
end

#rootObject

Returns the value of attribute root

Returns:

  • (Object)

    the current value of root



4
5
6
# File 'lib/betfair_api_ng_rails/api/logs/file_logger.rb', line 4

def root
  @root
end

Instance Method Details

#write(content) ⇒ Object



5
6
7
8
9
# File 'lib/betfair_api_ng_rails/api/logs/file_logger.rb', line 5

def write(content)
  File.open(file_path, 'a') do |file|
    file.puts "[#{now_date}] - #{content}"
  end
end