Class: Capybara::Harness::Dom::Attribute
- Inherits:
-
Object
- Object
- Capybara::Harness::Dom::Attribute
- Defined in:
- lib/capybara/harness/dom/attribute.rb
Instance Attribute Summary collapse
-
#derived_value_block ⇒ Object
Returns the value of attribute derived_value_block.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #derive_value(values = {}) ⇒ Object
-
#initialize(name, options = {}) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, options = {}) ⇒ Attribute
Returns a new instance of Attribute.
6 7 8 9 |
# File 'lib/capybara/harness/dom/attribute.rb', line 6 def initialize(name, = {}) self.name = name self.derived_value_block = .delete(:derived_value_block) end |
Instance Attribute Details
#derived_value_block ⇒ Object
Returns the value of attribute derived_value_block.
4 5 6 |
# File 'lib/capybara/harness/dom/attribute.rb', line 4 def derived_value_block @derived_value_block end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/capybara/harness/dom/attribute.rb', line 4 def name @name end |
Instance Method Details
#derive_value(values = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/capybara/harness/dom/attribute.rb', line 11 def derive_value(values = {}) if derived_value_block derived_value_block.call(values) else values.fetch(name, "") end end |