lib/yodeler.rb in yodeler-0.1.1 vs lib/yodeler.rb in yodeler-0.1.2
- old
+ new
@@ -1,15 +1,15 @@
-require "yaml"
+require 'yaml'
require 'forwardable'
-require "yodeler/version"
-require "yodeler/endpoint"
-require "yodeler/client"
-require "yodeler/metric"
+require 'yodeler/version'
+require 'yodeler/endpoint'
+require 'yodeler/client'
+require 'yodeler/metric'
-require "yodeler/duplicate_endpoint_name_error"
-require "yodeler/adapter_not_registered_error"
+require 'yodeler/duplicate_endpoint_name_error'
+require 'yodeler/adapter_not_registered_error'
module Yodeler
class << self
extend Forwardable
def_delegators :@client, :gauge, :increment, :timing, :publish
@@ -19,39 +19,35 @@
def setup!
@client = nil
@registered_adapters = {}
end
- def register_adapter(name,klass)
+ def register_adapter(name, klass)
@registered_adapters[name] = klass
end
#
# @private
def registered_adapters(name)
klass = @registered_adapters[name]
- if !klass
- raise AdapterNotRegisteredError.new(name: name)
- end
+ fail AdapterNotRegisteredError.new(name: name) unless klass
@registered_adapters[name]
end
# @private
def reset!
setup!
end
- def client
- @client
- end
+ attr_reader :client
def configure
@client = Yodeler::Client.new
yield @client
@client
end
end
end
Yodeler.setup!
-require "yodeler/adapters/memory_adapter"
-require "yodeler/adapters/http_adapter"
+require 'yodeler/adapters/memory_adapter'
+require 'yodeler/adapters/http_adapter'