Class: Nutritionix::APILogger
- Inherits:
-
Object
- Object
- Nutritionix::APILogger
- Defined in:
- lib/nutritionix/api_1_1.rb
Overview
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#logger_instance ⇒ Object
readonly
Returns the value of attribute logger_instance.
Class Method Summary collapse
-
.default_logger ⇒ Object
Returns the default logger(Logger) instance distributed by Ruby in its standard library.
Instance Method Summary collapse
-
#initialize(logger = nil, file = File.join(Dir.home, 'nutritionix_api_logs.txt')) ⇒ APILogger
constructor
A new instance of APILogger.
Constructor Details
#initialize(logger = nil, file = File.join(Dir.home, 'nutritionix_api_logs.txt')) ⇒ APILogger
Returns a new instance of APILogger.
190 191 192 193 |
# File 'lib/nutritionix/api_1_1.rb', line 190 def initialize(logger=nil, file=File.join(Dir.home, 'nutritionix_api_logs.txt')) @file = file @logger_instance = logger || Logger.new(@file) end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
186 187 188 |
# File 'lib/nutritionix/api_1_1.rb', line 186 def file @file end |
#logger_instance ⇒ Object (readonly)
Returns the value of attribute logger_instance.
185 186 187 |
# File 'lib/nutritionix/api_1_1.rb', line 185 def logger_instance @logger_instance end |