Class: Metaa::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/metaa/meta.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object = nil) ⇒ Meta

Returns a new instance of Meta.



5
6
7
# File 'lib/metaa/meta.rb', line 5

def initialize(object = nil)
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



3
4
5
# File 'lib/metaa/meta.rb', line 3

def object
  @object
end

Instance Method Details

#definitionsObject



13
14
15
# File 'lib/metaa/meta.rb', line 13

def definitions
  @definitions ||= []
end

#htmlObject



25
26
27
# File 'lib/metaa/meta.rb', line 25

def html
  tags.map(&:html).join.html_safe
end

#meta(attributes = {}) ⇒ Object



9
10
11
# File 'lib/metaa/meta.rb', line 9

def meta(attributes = {})
  definitions << Definition.new(attributes)
end

#tagsObject

lazy define meta tags then collect



18
19
20
21
22
23
# File 'lib/metaa/meta.rb', line 18

def tags
  @tags ||= begin
    define_meta
    collect_tags
  end
end