Class: L2meter::Configuration
- Inherits:
-
Object
- Object
- L2meter::Configuration
- Defined in:
- lib/l2meter/configuration.rb
Instance Attribute Summary collapse
- #context(&block) ⇒ Object
-
#float_precision ⇒ Object
Returns the value of attribute float_precision.
-
#key_formatter ⇒ Object
readonly
Returns the value of attribute key_formatter.
-
#output ⇒ Object
Returns the value of attribute output.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#scrubber ⇒ Object
Returns the value of attribute scrubber.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #compact_values=(value) ⇒ Object
- #compact_values? ⇒ Boolean
- #format_keys(&block) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #sort=(value) ⇒ Object
- #sort? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
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_precision ⇒ Object
Returns the value of attribute float_precision.
4 5 6 |
# File 'lib/l2meter/configuration.rb', line 4 def float_precision @float_precision end |
#key_formatter ⇒ Object (readonly)
Returns the value of attribute key_formatter.
5 6 7 |
# File 'lib/l2meter/configuration.rb', line 5 def key_formatter @key_formatter end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/l2meter/configuration.rb', line 5 def output @output end |
#prefix ⇒ Object
Returns the value of attribute prefix.
4 5 6 |
# File 'lib/l2meter/configuration.rb', line 4 def prefix @prefix end |
#scrubber ⇒ Object
Returns the value of attribute scrubber.
4 5 6 |
# File 'lib/l2meter/configuration.rb', line 4 def scrubber @scrubber end |
#source ⇒ Object
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
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
26 27 28 |
# File 'lib/l2meter/configuration.rb', line 26 def sort? @sort end |