Sha256: 745f847d022330e01ed4894e8b4aa5451dd554d0c2b25d799148f0d732612bd1

Contents?: true

Size: 296 Bytes

Versions: 3

Compression:

Stored size: 296 Bytes

Contents

require 'active_support/inflections'

module ActiveModel
  module CsverizerFactory
    def self.new(object, options = {})
      return ActiveModel::Csverizer.new(nil) if object.nil?
      klass = object.model_name.name + 'Csverizer'
      klass.constantize.new(object, options)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csverizer-0.0.7 lib/active_model/csverizer_factory.rb
csverizer-0.0.6 lib/active_model/csverizer_factory.rb
csverizer-0.0.5 lib/active_model/csverizer_factory.rb