class PageObject::SectionCollection
Public Class Methods
new(sections)
click to toggle source
# File lib/page-object/sections.rb, line 5 def initialize sections @sections = sections end
Public Instance Methods
[](index)
click to toggle source
# File lib/page-object/sections.rb, line 13 def [] index @sections[index] end
each(&block)
click to toggle source
# File lib/page-object/sections.rb, line 9 def each &block @sections.each &block end
find_by(values_hash)
click to toggle source
# File lib/page-object/sections.rb, line 17 def find_by values_hash @sections.find {|section| values_hash.all? {|method,value| value === section.public_send(method)} } end
select_by(values_hash)
click to toggle source
# File lib/page-object/sections.rb, line 23 def select_by values_hash SectionCollection.new @sections.select {|section| values_hash.all? {|method,value| value === section.public_send(method)} } end