Class: Landline::Probe
Overview
Test probe. Also base for all “reactive” nodes.
Direct Known Subclasses
Handlers::Handler, Handlers::Link, Handlers::Serve, Handlers::WebSockServer
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(path, parent:, **params) ⇒ 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:, **params) ⇒ Probe
Returns a new instance of Probe.
31 32 33 |
# File 'lib/landline/probe.rb', line 31 def initialize(path, parent:, **params) super(path, parent: parent, **params) end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
35 36 37 |
# File 'lib/landline/probe.rb', line 35 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.
43 44 45 46 47 48 49 50 |
# File 'lib/landline/probe.rb', line 43 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 |