class Howitzer::Meta::Section
This class represents section entity within howitzer meta information interface
Attributes
context[R]
name[R]
Public Class Methods
new(name, context)
click to toggle source
Creates meta section element with meta information and utility actions @param name [String] name of the section @param context [Howitzer::Web::Page] page which has this section
# File lib/howitzer/meta/section.rb, line 11 def initialize(name, context) @name = name @context = context end
Public Instance Methods
capybara_element()
click to toggle source
Finds section on the page and returns as a capybara element @return [Capybara::Node::Element, nil]
# File lib/howitzer/meta/section.rb, line 24 def capybara_element section = context.send("#{name}_sections").first section.try(:capybara_context) end
capybara_elements()
click to toggle source
Finds all instances of section on the page and returns them as array of capybara elements @return [Array]
# File lib/howitzer/meta/section.rb, line 18 def capybara_elements context.send("#{name}_sections").map(&:capybara_context) end