instruments 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/instruments.rb +17 -5
- metadata +1 -1
data/lib/instruments.rb
CHANGED
@@ -7,13 +7,25 @@ module Instruments
|
|
7
7
|
DB_ERROR = ENV["DB_ERROR"] || 1000
|
8
8
|
|
9
9
|
def self.defaults=(args)
|
10
|
-
@logger = args[:logger]
|
11
|
-
@method = args[:method]
|
12
|
-
@default_data = args[:data]
|
10
|
+
@logger = args[:logger]
|
11
|
+
@method = args[:method]
|
12
|
+
@default_data = args[:data]
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.
|
16
|
-
@logger
|
15
|
+
def self.logger
|
16
|
+
@logger || Kernel
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.method
|
20
|
+
@method || :puts
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.default_data
|
24
|
+
@default_data || {}
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.write(data={})
|
28
|
+
logger.send(method, data.merge(default_data))
|
17
29
|
end
|
18
30
|
|
19
31
|
if defined?(::Sinatra)
|