Class: Hyde::Probe
Overview
Test probe. Also base for all “reactive” nodes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(path, parent:) ⇒ Probe
constructor
A new instance of Probe.
-
#process(request) ⇒ Boolean
Method callback on successful request navigation.
Methods inherited from Node
Constructor Details
#initialize(path, parent:) ⇒ Probe
Returns a new instance of Probe.
23 24 25 |
# File 'lib/hyde/probe.rb', line 23 def initialize(path, parent:) super(path, parent: parent) end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
27 28 29 |
# File 'lib/hyde/probe.rb', line 27 def properties @properties end |
Instance Method Details
#process(request) ⇒ Boolean
Method callback on successful request navigation. Throws an error upon reaching the path. This behaviour should only be used internally.
35 36 37 38 39 40 41 42 |
# File 'lib/hyde/probe.rb', line 35 def process(request) return reject(request) unless request.path.match?(/^\/?$/) raise StandardError, <<~STREND probe reached #{request.splat.inspect}, #{request.param.inspect} #{request.pretty_inspect} STREND end |