Module: Howitzer::Web::SectionDsl::ClassMethods
- Includes:
- Utils::ArgumentConvertable
- Defined in:
- lib/howitzer/web/section_dsl.rb
Overview
This module holds section dsl class methods
Defined Under Namespace
Classes: SectionScope
Instance Method Summary collapse
-
#section(name, *args, **options, &block) ⇒ Object
DSL method which defines named or anonymous section within a page or a section.
Instance Method Details
#section(name, *args, **options, &block) ⇒ Object
Note:
This method generates following dynamic methods:
section_name_section - equals capybara #find(…) method
section_name_sections - equals capybara #all(…) method
section_name_sections.first - equals capybara #first(…) method
has_section_name_section? - equals capybara #has_selector(…) method
has_no_section_name_section? - equals capybara #has_no_selector(…) method
Note:
It is possible to use nested anonymous sections
DSL method which defines named or anonymous section within a page or a section
127 128 129 130 131 132 133 |
# File 'lib/howitzer/web/section_dsl.rb', line 127 def section(name, *args, **, &block) scope = SectionScope.new(name, *args, **, &block) define_section_method(scope.section_class, name, *scope.finder_args, **scope.) define_sections_method(scope.section_class, name, *scope.finder_args, **scope.) define_has_section_method(name, *scope.finder_args, **scope.) define_has_no_section_method(name, *scope.finder_args, **scope.) end |