Method: OpenGraphReader::Object::DSL#namespace

Defined in:
lib/open_graph_reader/object/dsl.rb

#namespaceString #namespace(*names) ⇒ Object

Overloads:

  • #namespaceString

    Get the namespace of this object.

    Returns:

    • (String)

      A colon separated namespace, for example og:image.

  • #namespace(*names) ⇒ Object

    Set the namespace of this object.

    Examples:

    namespace :og, :image

    Parameters:

    • *names (Array<#to_s>)

      The individual parts of the namespace as list



115
116
117
118
119
# File 'lib/open_graph_reader/object/dsl.rb', line 115

def namespace *names
  return @namespace if names.empty?
  @namespace = names.join(":")
  Registry.register @namespace, self
end