Class: Reflekt::Config
- Inherits:
-
Object
- Object
- Reflekt::Config
- Defined in:
- lib/config.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#meta_map ⇒ Object
Returns the value of attribute meta_map.
-
#output_directory ⇒ Object
Returns the value of attribute output_directory.
-
#project_path ⇒ Object
Returns the value of attribute project_path.
-
#reflect_amount ⇒ Object
Returns the value of attribute reflect_amount.
-
#reflect_limit ⇒ Object
Returns the value of attribute reflect_limit.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
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 41 42 43 44 45 |
# 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 |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
4 5 6 |
# File 'lib/config.rb', line 4 def enabled @enabled end |
#meta_map ⇒ Object
Returns the value of attribute meta_map.
7 8 9 |
# File 'lib/config.rb', line 7 def @meta_map end |
#output_directory ⇒ Object
Returns the value of attribute output_directory.
9 10 11 |
# File 'lib/config.rb', line 9 def output_directory @output_directory end |
#project_path ⇒ Object
Returns the value of attribute project_path.
8 9 10 |
# File 'lib/config.rb', line 8 def project_path @project_path end |
#reflect_amount ⇒ Object
Returns the value of attribute reflect_amount.
5 6 7 |
# File 'lib/config.rb', line 5 def reflect_amount @reflect_amount end |
#reflect_limit ⇒ Object
Returns the value of attribute reflect_limit.
6 7 8 |
# File 'lib/config.rb', line 6 def reflect_limit @reflect_limit end |