Class: Howitzer::Meta::Section
- Inherits:
-
Object
- Object
- Howitzer::Meta::Section
- Includes:
- Actions
- Defined in:
- lib/howitzer/meta/section.rb
Overview
This class represents section entity within howitzer meta information interface
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#capybara_element ⇒ Capybara::Node::Element?
Finds section on the page and returns as a capybara element.
-
#capybara_elements ⇒ Array
Finds all instances of section on the page and returns them as array of capybara elements.
-
#initialize(name, context) ⇒ Section
constructor
Creates meta section element with meta information and utility actions.
Methods included from Actions
Constructor Details
#initialize(name, context) ⇒ Section
Creates meta section element with meta information and utility actions
11 12 13 14 |
# File 'lib/howitzer/meta/section.rb', line 11 def initialize(name, context) @name = name @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/howitzer/meta/section.rb', line 5 def context @context end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/howitzer/meta/section.rb', line 5 def name @name end |
Instance Method Details
#capybara_element ⇒ Capybara::Node::Element?
Finds section on the page and returns as a capybara element
24 25 26 27 |
# File 'lib/howitzer/meta/section.rb', line 24 def section = context.send("#{name}_sections").first section.try(:capybara_context) end |
#capybara_elements ⇒ Array
Finds all instances of section on the page and returns them as array of capybara elements
18 19 20 |
# File 'lib/howitzer/meta/section.rb', line 18 def context.send("#{name}_sections").map(&:capybara_context) end |