Class: Storey::Dumper

Inherits:
Object
  • Object
show all
Defined in:
lib/storey/dumper.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Dumper

Returns a new instance of Dumper.



7
8
9
# File 'lib/storey/dumper.rb', line 7

def initialize(options={})
  @options = options
end

Instance Method Details

#dumperObject



11
12
13
# File 'lib/storey/dumper.rb', line 11

def dumper
  dumper_class.new(@options)
end

#dumper_classObject



15
16
17
18
19
20
# File 'lib/storey/dumper.rb', line 15

def dumper_class
  schema_format = Rails.configuration.active_record.schema_format || :ruby
  class_name = "#{schema_format.to_s.classify}Dumper"
  namespace = self.class.name.deconstantize.constantize
  namespace.const_get class_name
end