Sha256: c2ca23e9009ff8f08d26e425199eaef689bdb602f862d44f925f95efb6bd53ea

Contents?: true

Size: 400 Bytes

Versions: 13

Compression:

Stored size: 400 Bytes

Contents

module PageObject
  class SectionCollection < Array
    def find_by(values_hash)
      find do |section|
        values_hash.all? { |key, value| value === section.public_send(key) }
      end
    end

    def select_by(values_hash)
      matches = select do |section|
        values_hash.all? { |key, value| value === section.public_send(key) }
      end
      self.class[*matches]
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
page-object-2.2.6 lib/page-object/section_collection.rb
page-object-2.2.5 lib/page-object/section_collection.rb
page-object-2.2.4 lib/page-object/section_collection.rb
page-object-2.2.3 lib/page-object/section_collection.rb
page-object-2.2.2 lib/page-object/section_collection.rb
page-object-2.2.1 lib/page-object/section_collection.rb
page-object-2.2 lib/page-object/section_collection.rb
page-object-2.1.1 lib/page-object/section_collection.rb
page-object-2.1 lib/page-object/section_collection.rb
page-object-2.0.0 lib/page-object/section_collection.rb
page-object-1.2.2 lib/page-object/section_collection.rb
page-object-1.2.1 lib/page-object/section_collection.rb
page-object-1.2.0 lib/page-object/section_collection.rb