instruments 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/instruments.rb +17 -5
  2. 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] || Kernel
11
- @method = args[:method] || :puts
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.write(data)
16
- @logger.send(@method, data.merge(@default_data))
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instruments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: