Class: Napybara::FinderMethodsAppender
- Inherits:
-
Object
- Object
- Napybara::FinderMethodsAppender
- Defined in:
- lib/napybara/finder_methods_appender.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#child_element_name ⇒ Object
readonly
Returns the value of attribute child_element_name.
-
#child_element_selector ⇒ Object
readonly
Returns the value of attribute child_element_selector.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#optional_args ⇒ Object
readonly
Returns the value of attribute optional_args.
Instance Method Summary collapse
- #capybara_options ⇒ Object
- #execute ⇒ Object
-
#initialize(element, child_element_name, child_element_selector, optional_args, block) ⇒ FinderMethodsAppender
constructor
A new instance of FinderMethodsAppender.
- #record_selector ⇒ Object
Constructor Details
#initialize(element, child_element_name, child_element_selector, optional_args, block) ⇒ FinderMethodsAppender
Returns a new instance of FinderMethodsAppender.
8 9 10 11 12 13 |
# File 'lib/napybara/finder_methods_appender.rb', line 8 def initialize( element, child_element_name, child_element_selector, optional_args, block) @element, @child_element_name, @child_element_selector, @optional_args, @block = element, child_element_name, child_element_selector, optional_args, block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
5 6 7 |
# File 'lib/napybara/finder_methods_appender.rb', line 5 def block @block end |
#child_element_name ⇒ Object (readonly)
Returns the value of attribute child_element_name.
5 6 7 |
# File 'lib/napybara/finder_methods_appender.rb', line 5 def child_element_name @child_element_name end |
#child_element_selector ⇒ Object (readonly)
Returns the value of attribute child_element_selector.
5 6 7 |
# File 'lib/napybara/finder_methods_appender.rb', line 5 def child_element_selector @child_element_selector end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
5 6 7 |
# File 'lib/napybara/finder_methods_appender.rb', line 5 def element @element end |
#optional_args ⇒ Object (readonly)
Returns the value of attribute optional_args.
5 6 7 |
# File 'lib/napybara/finder_methods_appender.rb', line 5 def optional_args @optional_args end |
Instance Method Details
#capybara_options ⇒ Object
22 23 24 25 26 27 |
# File 'lib/napybara/finder_methods_appender.rb', line 22 def return {} if optional_args.empty? return {} if !optional_args.last.is_a?(Hash) optional_args.last end |
#execute ⇒ Object
29 30 31 32 33 34 |
# File 'lib/napybara/finder_methods_appender.rb', line 29 def execute define_child_element_method define_has_child_element_method define_has_no_child_element_method define_child_elements_method end |
#record_selector ⇒ Object
15 16 17 18 19 20 |
# File 'lib/napybara/finder_methods_appender.rb', line 15 def record_selector return if optional_args.empty? return if !optional_args[0].is_a?(String) optional_args[0] end |