Sha256: 02192a0d2e328d21e92cfce445df69815927846d695dfcdc01916801f9128f7a

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 Bytes

Contents

module Putter
  class Configuration
    attr_accessor :print_strategy, :allow_production
    attr_writer :ignore_methods_from, :methods_whitelist

    def initialize
      @ignore_methods_from = [Object]
      @ignore_methods_from << ActiveRecord::Base if defined?(ActiveRecord::Base)
      @print_strategy = PrintStrategy::Default
      @allow_production = false
      @methods_whitelist = []
    end

    def ignore_methods_from
      _convert_to_array(@ignore_methods_from)
    end

    def methods_whitelist
      _convert_to_array(@methods_whitelist)
    end

    def _convert_to_array(val)
      if val.nil?
        []
      elsif !val.is_a?(Array)
        [val]
      else
        val
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
putter-0.4.1 lib/putter/configuration.rb