class Reflekt::Config

Attributes

enabled[RW]
meta_map[RW]
output_directory[RW]
project_path[RW]
reflect_amount[RW]
reflect_limit[RW]

Public Class Methods

new() click to toggle source
# File lib/config.rb, line 11
def initialize()

  # Reflekt is enabled by default and should be disabled on production.
  @enabled = true

  # Reflekt is untracked in git by default.
  @git_ignore = true

  # The amount of reflections to create per method call.
  # A control reflection is created in addition to this.
  @reflect_amount = 5

  # The maximum amount of reflections that can be created per instance per method.
  # A method called thousands of times doesn't need that many reflections.
  @reflect_limit = 10

  # The rules that apply to meta types.
  @meta_map = {
    :array  => [ArrayRule],
    :bool   => [BooleanRule],
    :int    => [IntegerRule],
    :float  => [FloatRule],
    :null   => [NullRule],
    :object => [ObjectRule],
    :string => [StringRule]
  }

  # An absolute path to the project root directory.
  # Defaults to current execution path.
  @project_path = Dir.pwd

  # Name of output directory.
  @output_directory = "reflections"

end