Sha256: f1846fd0fe6e06bfa41dafb8e59c2beebb145448da434e2b8956dcbc707d9266

Contents?: true

Size: 498 Bytes

Versions: 8

Compression:

Stored size: 498 Bytes

Contents

# frozen_string_literal: true

module HoTModuLe
  # Add a couple familar DOM API features to Nokogiri
  module QuerySelection
    # @param selector [String]
    # @return [Nokogiri::XML::Element]
    def query_selector(selector) = at_css(selector)

    # @param selector [String]
    # @return [Nokogiri::XML::Element]
    def query_selector_all(selector) = css(selector)
  end

  Nokolexbor::Element.include QuerySelection unless Nokolexbor::Element.instance_methods.include?(:query_selector)
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hot_module-1.0.0.alpha10 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha9 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha8 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha7 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha6 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha5 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha4 lib/hot_module/query_selection.rb
hot_module-1.0.0.alpha3 lib/hot_module/query_selection.rb