Sha256: 4edf3427bb8b13427f40665004b7d86224f3f49879934a597a88e5df9e0cd528

Contents?: true

Size: 564 Bytes

Versions: 4

Compression:

Stored size: 564 Bytes

Contents

module DaruLite
  # Defines constants and methods related to configuration
  module Configuration
    INSPECT_OPTIONS_KEYS = [
      :max_rows,
      # Terminal
      :spacing
    ].freeze

    # Jupyter
    DEFAULT_MAX_ROWS = 30

    # Terminal
    DEFAULT_SPACING = 10

    attr_accessor(*INSPECT_OPTIONS_KEYS)

    def configure
      yield self
    end

    def self.extended(base)
      base.reset_options
    end

    def reset_options
      self.max_rows  = DEFAULT_MAX_ROWS

      self.spacing   = DEFAULT_SPACING
    end
  end

  extend Configuration
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
daru_lite-0.1.3 lib/daru_lite/configuration.rb
daru_lite-0.1.2 lib/daru_lite/configuration.rb
daru_lite-0.1.1 lib/daru_lite/configuration.rb
daru_lite-0.1 lib/daru_lite/configuration.rb