Class: ErpTechSvcs::FileSupport::Base
- Inherits:
-
Object
- Object
- ErpTechSvcs::FileSupport::Base
- Defined in:
- lib/erp_tech_svcs/file_support/base.rb
Instance Attribute Summary collapse
-
#storage ⇒ Object
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #method_missing(m, *args, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/erp_tech_svcs/file_support/base.rb', line 11 def initialize(={}) @storage = [:storage].nil? ? :filesystem : [:storage] case @storage when :s3 @manager = S3Manager.new when :filesystem @manager = FileSystemManager.new end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
22 23 24 |
# File 'lib/erp_tech_svcs/file_support/base.rb', line 22 def method_missing(m, *args, &block) @manager.respond_to?(m) ? @manager.send(m, *args) : super end |
Instance Attribute Details
#storage ⇒ Object
Returns the value of attribute storage.
9 10 11 |
# File 'lib/erp_tech_svcs/file_support/base.rb', line 9 def storage @storage end |