Class: Nosey::Probe::Base
- Inherits:
-
Object
- Object
- Nosey::Probe::Base
- Defined in:
- lib/nosey/probe.rb
Overview
Base class for containing key/value pairs in nosey. This class is responsible for reseting probes.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name = nil, value = nil) ⇒ Base
constructor
A new instance of Base.
-
#reset ⇒ Object
Reset the value to nil.
-
#set(value) ⇒ Object
Set the value (don’t increment or whateves).
-
#to_hash ⇒ Object
Representation of this probe.
Constructor Details
#initialize(name = nil, value = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/nosey/probe.rb', line 9 def initialize(name=nil, value=nil) @name, @value = name, value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/nosey/probe.rb', line 6 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/nosey/probe.rb', line 7 def value @value end |
Instance Method Details
#reset ⇒ Object
Reset the value to nil
19 20 21 |
# File 'lib/nosey/probe.rb', line 19 def reset @value = nil end |
#set(value) ⇒ Object
Set the value (don’t increment or whateves)
14 15 16 |
# File 'lib/nosey/probe.rb', line 14 def set(value) @value = value end |
#to_hash ⇒ Object
Representation of this probe
24 25 26 |
# File 'lib/nosey/probe.rb', line 24 def to_hash { name => value } end |