Sha256: c98426282bfd5ebdbd42307060a48f85b6df2750380903a4f4beef2916a30560

Contents?: true

Size: 485 Bytes

Versions: 8

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

require 'aranha/parsers/html/base'

module Aranha
  module Parsers
    module Html
      class Item < Base
        def data
          @data ||= node_parser.parse(item_node)
        end

        def item_node
          @item_node ||= begin
            r = item_xpath ? nokogiri.at_xpath(item_xpath) : nokogiri
            raise "Item node not found (Item xpath: #{item_xpath})" unless r
            r
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
aranha-parsers-0.2.2 lib/aranha/parsers/html/item.rb
aranha-parsers-0.2.1 lib/aranha/parsers/html/item.rb
aranha-parsers-0.2.0 lib/aranha/parsers/html/item.rb
aranha-parsers-0.1.1 lib/aranha/parsers/html/item.rb
aranha-parsers-0.1.0 lib/aranha/parsers/html/item.rb
aranha-0.10.1 lib/aranha/parsers/html/item.rb
aranha-0.10.0 lib/aranha/parsers/html/item.rb
aranha-0.9.1 lib/aranha/parsers/html/item.rb