Class: Testable::Node
- Includes:
- DSL
- Defined in:
- lib/testable/capybara/node.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(node:) ⇒ Node
constructor
A Capybara node is being wrapped in a node instance.
-
#method_missing(name, *args, &block) ⇒ Object
Any Capybara API calls will be sent to the node object.
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Methods included from DSL
Constructor Details
#initialize(node:) ⇒ Node
A Capybara node is being wrapped in a node instance.
13 14 15 |
# File 'lib/testable/capybara/node.rb', line 13 def initialize(node:) @node = node end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Any Capybara API calls will be sent to the node object.
18 19 20 21 22 23 24 |
# File 'lib/testable/capybara/node.rb', line 18 def method_missing(name, *args, &block) if @node.respond_to?(name) @node.send(name, *args, &block) else super end end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
10 11 12 |
# File 'lib/testable/capybara/node.rb', line 10 def node @node end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
26 27 28 |
# File 'lib/testable/capybara/node.rb', line 26 def respond_to_missing?(name, include_private = false) @node.respond_to?(name) || super end |