class OpenGraphReader::Base

You get an instance of this class as result of your quest to obtain an OpenGraph object. It simply contains and returns the root objects, most commonly og.

Attributes

bases[R]

Return the stored root objects as a hash.

@api private @return [String => Object]

children[R]

Return the stored root objects as a hash.

@api private @return [String => Object]

origin[RW]

If available, contains the source location of the document the available objects were parsed from.

@return [String, nil]

Public Class Methods

new() click to toggle source

@api private

# File lib/open_graph_reader/base.rb, line 50
def initialize
  @bases = {}
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source

Makes the found root objects available. @return [Object]

Calls superclass method
# File lib/open_graph_reader/base.rb, line 61
def method_missing(method, *args, &block)
  name = method.to_s
  if respond_to_missing? name
    @bases[name]
  else
    super(method, *args, &block)
  end
end
respond_to_missing?(method, _include_private=false) click to toggle source

@private

# File lib/open_graph_reader/base.rb, line 55
def respond_to_missing?(method, _include_private=false)
  @bases.has_key? method.to_s
end