Class: L2meter::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
# File 'lib/l2meter/configuration.rb', line 13

def initialize
  @sort = false
  @key_formatter = DEFAULT_KEY_FORMATTER
  @output = $stdout
  @float_precision = 4
  @context = nil
  @compact_values = true
end

Instance Attribute Details

#context(&block) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/l2meter/configuration.rb', line 42

def context(&block)
  if block
    @context = block
  else
    @context
  end
end

#float_precisionObject

Returns the value of attribute float_precision.



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

def float_precision
  @float_precision
end

#key_formatterObject (readonly)

Returns the value of attribute key_formatter.



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

def key_formatter
  @key_formatter
end

#outputObject

Returns the value of attribute output.



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

def output
  @output
end

#prefixObject

Returns the value of attribute prefix.



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

def prefix
  @prefix
end

#scrubberObject

Returns the value of attribute scrubber.



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

def scrubber
  @scrubber
end

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#compact_values=(value) ⇒ Object



38
39
40
# File 'lib/l2meter/configuration.rb', line 38

def compact_values=(value)
  @compact_values = !!value
end

#compact_values?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/l2meter/configuration.rb', line 34

def compact_values?
  @compact_values
end

#format_keys(&block) ⇒ Object



22
23
24
# File 'lib/l2meter/configuration.rb', line 22

def format_keys(&block)
  @key_formatter = block
end

#sort=(value) ⇒ Object



30
31
32
# File 'lib/l2meter/configuration.rb', line 30

def sort=(value)
  @sort = !!value
end

#sort?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/l2meter/configuration.rb', line 26

def sort?
  @sort
end