class Opengraphaul::Base

Attributes

og_image[RW]
og_title[RW]
og_type[RW]
og_url[RW]
url[RW]

Public Class Methods

new(url) click to toggle source
# File lib/opengraphaul.rb, line 10
def initialize(url)
  @url = url
  @og_image = process("meta[property='og:image']")
  @og_title = process("meta[property='og:title']")
  @og_type = process("meta[property='og:type']")
  @og_url = process("meta[property='og:url']")

end

Private Instance Methods

process(type) click to toggle source
# File lib/opengraphaul.rb, line 20
def process(type)
  Nokogiri::HTML(open(self.url)).css(type)
end