Class: PrintOptions

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

Overview

print_options.rb © 2023 Masato Kokubo Hold output option values.

Instance Method Summary collapse

Constructor Details

#initialize(force_reflection, output_private, output_method, collection_limit, string_limit, bytes_limit, reflection_nest_limit) ⇒ PrintOptions

Initializes this object.

Parameters:

  • force_reflection (bool)

    : If true, outputs using reflection even if it has a @_str__or @repr_ method

  • output_private (bool)

    : If true, also outputs private members when using reflection

  • output_method (bool)

    : If true, also outputs method members when using reflection

  • collection_limit (Integer)

    : Output limit of collection elements (overrides debugtarace.ini value)

  • string_limit (Integer)

    : Output limit of string characters (overrides debugtarace.ini value)

  • bytes_limit (Integer)

    : Output limit of byte array elements (overrides debugtarace.ini value)

  • reflection_nest_limit (Integer)

    : Nest limits when using reflection (overrides debugtarace.ini value)



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/debugtrace/print_options.rb', line 13

def initialize(
  force_reflection, output_private, output_method,
  collection_limit, string_limit, bytes_limit, reflection_nest_limit)
  @force_reflection      = force_reflection
  @output_private        = output_private
  @output_method         = output_method
  @collection_limit      = collection_limit      == -1 ? @config.collection_limit      : collection_limit   
  @string_limit          = string_limit          == -1 ? @config.string_limit          : string_limit     
  @bytes_limit           = bytes_limit           == -1 ? @config.bytes_limit           : bytes_limit      
  @reflection_nest_limit = reflection_nest_limit == -1 ? @config.reflection_nest_limit : reflection_nest_limit
end