Class: L2meter::Configuration
- Inherits:
-
Object
- Object
- L2meter::Configuration
- Defined in:
- lib/l2meter/configuration.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#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.
-
#source ⇒ Object
Returns the value of attribute source.
-
#value_formatter ⇒ Object
readonly
Returns the value of attribute value_formatter.
Instance Method Summary collapse
- #format_keys(&block) ⇒ Object
- #format_values(&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.
18 19 20 21 22 23 |
# File 'lib/l2meter/configuration.rb', line 18 def initialize @sort = false @key_formatter = DEFAULT_KEY_FORMATTER @value_formatter = DEFAULT_VALUE_FORMATTER @output = $stdout end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
5 6 7 |
# File 'lib/l2meter/configuration.rb', line 5 def context @context 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 |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/l2meter/configuration.rb', line 4 def source @source end |
#value_formatter ⇒ Object (readonly)
Returns the value of attribute value_formatter.
5 6 7 |
# File 'lib/l2meter/configuration.rb', line 5 def value_formatter @value_formatter end |
Instance Method Details
#format_keys(&block) ⇒ Object
25 26 27 |
# File 'lib/l2meter/configuration.rb', line 25 def format_keys(&block) @key_formatter = block end |
#format_values(&block) ⇒ Object
29 30 31 |
# File 'lib/l2meter/configuration.rb', line 29 def format_values(&block) @value_formatter = block end |
#sort=(value) ⇒ Object
37 38 39 |
# File 'lib/l2meter/configuration.rb', line 37 def sort=(value) @sort = !!value end |
#sort? ⇒ Boolean
33 34 35 |
# File 'lib/l2meter/configuration.rb', line 33 def sort? @sort end |