Class: Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/config.rb', line 10

def initialize()

  # Reflekt is enabled by default and should be disabled on production.
  @enabled = 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/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],
    :string => [StringRule]
  }

  # An absolute path to the directory that contains the output directory.
  # Defaults to current action path.
  @output_path = nil

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

end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/config.rb', line 3

def enabled
  @enabled
end

#meta_mapObject

Returns the value of attribute meta_map.



6
7
8
# File 'lib/config.rb', line 6

def meta_map
  @meta_map
end

#output_directoryObject

Returns the value of attribute output_directory.



8
9
10
# File 'lib/config.rb', line 8

def output_directory
  @output_directory
end

#output_pathObject

Returns the value of attribute output_path.



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

def output_path
  @output_path
end

#reflect_amountObject

Returns the value of attribute reflect_amount.



4
5
6
# File 'lib/config.rb', line 4

def reflect_amount
  @reflect_amount
end

#reflect_limitObject

Returns the value of attribute reflect_limit.



5
6
7
# File 'lib/config.rb', line 5

def reflect_limit
  @reflect_limit
end