Class: ErpTechSvcs::FileSupport::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_tech_svcs/file_support/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  @storage = options[:storage].nil? ? :filesystem : options[: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

#storageObject

Returns the value of attribute storage.



9
10
11
# File 'lib/erp_tech_svcs/file_support/base.rb', line 9

def storage
  @storage
end