Class: OpenGraphPlus::Tags::Base

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/opengraphplus/tags.rb

Direct Known Subclasses

Image, OpenGraph, Plus, Root, Twitter

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/opengraphplus/tags.rb', line 10

def each(&block)
  tags.each do |t|
    case t
    when Base
      t.each(&block)
    when Tag
      yield t if t.content
    end
  end
end

#render_in(view_context) ⇒ Object



23
24
25
# File 'lib/opengraphplus/tags.rb', line 23

def render_in(view_context)
  map { |tag| tag.render_in(view_context) }.join("\n")
end

#tagsObject



21
# File 'lib/opengraphplus/tags.rb', line 21

def tags = []

#update(**kwargs) ⇒ Object



27
28
29
30
# File 'lib/opengraphplus/tags.rb', line 27

def update(**kwargs)
  kwargs.each { |key, value| public_send(:"#{key}=", value) }
  self
end