charty 0.1.5.dev → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +0,0 @@
1
- module Charty
2
- class AdapterNotLoadedError < RuntimeError; end
3
-
4
- class PlotterAdapter
5
- def self.inherited(adapter_class)
6
- @adapters ||= []
7
- @adapters << adapter_class
8
- end
9
-
10
- def self.create(adapter_name)
11
- require "charty/backends/#{adapter_name}"
12
- adapter = @adapters.find {|adapter| adapter::Name.to_s == adapter_name.to_s }
13
- raise AdapterNotLoadedError.new("Adapter for '#{adapter_name}' is not found.") unless adapter
14
- adapter.new
15
- end
16
- end
17
- end