Class: DebugTrace::PrintOptions

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

Overview

Contains options to pass to the print method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reflection, minimum_output_size, minimum_output_length, output_size_limit, output_length_limit, reflection_limit) ⇒ PrintOptions

Initializes this object.

Parameters:

  • reflection (TrueClass, FalseClass)

    use reflection if true

  • minimum_output_size (Integer)

    the minimum value to output the number of elements for Array and Hash (overrides debugtarace.yml value)

  • minimum_output_length (Integer)

    the minimum value to output the length of String and byte array (overrides debugtarace.yml value)

  • output_size_limit (Integer)

    Output limit of collection elements (overrides debugtarace.yml value)

  • output_length_limit (Integer)

    the limit value of characters for string to output (overrides debugtarace.yml value)

  • reflection_limit (Integer)

    reflection limits when using reflection (overrides debugtarace.yml value)



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/debugtrace.rb', line 100

def initialize(
  reflection,
  minimum_output_size,
  minimum_output_length,
  output_size_limit,
  output_length_limit,
  reflection_limit
)
  @reflection = reflection
  @minimum_output_size = minimum_output_size == -1 ? DebugTrace.config.minimum_output_size : minimum_output_size
  @minimum_output_length = minimum_output_length == -1 ? DebugTrace.config.minimum_output_length : minimum_output_length
  @output_size_limit = output_size_limit == -1 ? DebugTrace.config.output_size_limit : output_size_limit
  @output_length_limit = output_length_limit == -1 ? DebugTrace.config.output_length_limit : output_length_limit
  @reflection_limit = reflection_limit == -1 ? DebugTrace.config.reflection_limit : reflection_limit
end

Instance Attribute Details

#minimum_output_lengthObject (readonly)

Returns the value of attribute minimum_output_length.



89
90
91
# File 'lib/debugtrace.rb', line 89

def minimum_output_length
  @minimum_output_length
end

#minimum_output_sizeObject (readonly)

Returns the value of attribute minimum_output_size.



89
90
91
# File 'lib/debugtrace.rb', line 89

def minimum_output_size
  @minimum_output_size
end

#output_length_limitObject (readonly)

Returns the value of attribute output_length_limit.



89
90
91
# File 'lib/debugtrace.rb', line 89

def output_length_limit
  @output_length_limit
end

#output_size_limitObject (readonly)

Returns the value of attribute output_size_limit.



89
90
91
# File 'lib/debugtrace.rb', line 89

def output_size_limit
  @output_size_limit
end

#reflectionObject (readonly)

Returns the value of attribute reflection.



89
90
91
# File 'lib/debugtrace.rb', line 89

def reflection
  @reflection
end

#reflection_limitObject (readonly)

Returns the value of attribute reflection_limit.



89
90
91
# File 'lib/debugtrace.rb', line 89

def reflection_limit
  @reflection_limit
end