Sha256: 4eb662773b8ae4eb6fb85621dc66bcdf99c26174dcf6a9de26906564525aecc1

Contents?: true

Size: 559 Bytes

Versions: 10

Compression:

Stored size: 559 Bytes

Contents

class LinkOracle
  module Extractor
    class OG < Base
      def type
        :og
      end

      def title
        get_content("//meta[@property='og:title']")
      end

      def image
        return image_data if !image_data.first
        image_is_path? ? [] : image_data
      end

      def description
        get_content("//meta[@property='og:description']")
      end

      def image_is_path?
        !!(image_data.first.match(/\A\//))
      end

      def image_data
        get_content("//meta[@property='og:image']")
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
link_oracle-0.1.11 lib/link_oracle/extractor/og.rb
link_oracle-0.1.10 lib/link_oracle/extractor/og.rb
link_oracle-0.1.9 lib/link_oracle/extractor/og.rb
link_oracle-0.1.8 lib/link_oracle/extractor/og.rb
link_oracle-0.1.7 lib/link_oracle/extractor/og.rb
link_oracle-0.1.6 lib/link_oracle/extractor/og.rb
link_oracle-0.1.5 lib/link_oracle/extractor/og.rb
link_oracle-0.1.4 lib/link_oracle/extractor/og.rb
link_oracle-0.1.3 lib/link_oracle/extractor/og.rb
link_oracle-0.1.2 lib/link_oracle/extractor/og.rb