Class: OpenGraphPlus::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/opengraphplus/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, content) ⇒ Tag

Returns a new instance of Tag.



9
10
11
12
# File 'lib/opengraphplus/tag.rb', line 9

def initialize(property, content)
  @property = property
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/opengraphplus/tag.rb', line 7

def content
  @content
end

#propertyObject (readonly)

Returns the value of attribute property.



7
8
9
# File 'lib/opengraphplus/tag.rb', line 7

def property
  @property
end

Instance Method Details

#metaObject



14
15
16
# File 'lib/opengraphplus/tag.rb', line 14

def meta
  %(<meta property="#{escape property}" content="#{escape content}">)
end

#render_in(_view_context = nil) ⇒ Object



18
19
20
# File 'lib/opengraphplus/tag.rb', line 18

def render_in(_view_context = nil)
  meta.html_safe
end

#to_sObject



22
23
24
# File 'lib/opengraphplus/tag.rb', line 22

def to_s
  meta
end