Class: Dandelion::Adapter::Base
- Inherits:
-
Object
- Object
- Dandelion::Adapter::Base
- Defined in:
- lib/dandelion/adapter.rb
Direct Known Subclasses
FTP, NoOpAdapter, S3, SFTP
Constant Summary collapse
- @@adapters =
{}
Class Attribute Summary collapse
-
.required_gems ⇒ Object
readonly
Returns the value of attribute required_gems.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
36 37 |
# File 'lib/dandelion/adapter.rb', line 36 def initialize() end |
Class Attribute Details
.required_gems ⇒ Object (readonly)
Returns the value of attribute required_gems.
29 30 31 |
# File 'lib/dandelion/adapter.rb', line 29 def required_gems @required_gems end |
Class Method Details
.adapter(name) ⇒ Object
17 18 19 |
# File 'lib/dandelion/adapter.rb', line 17 def adapter(name) @@adapters[name] = self end |
.create_adapter(name, options = {}) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/dandelion/adapter.rb', line 21 def create_adapter(name, = {}) klass = @@adapters[name] raise InvalidAdapterError if klass.nil? klass.new() rescue LoadError raise MissingDependencyError.new(klass.required_gems) end |
.requires_gems(*gems) ⇒ Object
31 32 33 |
# File 'lib/dandelion/adapter.rb', line 31 def requires_gems(*gems) @required_gems = gems end |