Class: Barometer::Support::Matchers::Walker
- Inherits:
-
Object
- Object
- Barometer::Support::Matchers::Walker
- Defined in:
- lib/barometer/support/matchers/walker.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #follow(paths) ⇒ Object
-
#initialize(value) ⇒ Walker
constructor
A new instance of Walker.
Constructor Details
#initialize(value) ⇒ Walker
Returns a new instance of Walker.
7 8 9 |
# File 'lib/barometer/support/matchers/walker.rb', line 7 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/barometer/support/matchers/walker.rb', line 5 def value @value end |
Instance Method Details
#follow(paths) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/barometer/support/matchers/walker.rb', line 11 def follow(paths) path_value = value paths.each do |path| path_value = path_value.send(path) end if path_value.respond_to?(:strftime) path_value.strftime("%Y-%m-%d %H:%M:%S %z") else path_value.to_s end end |