Module: Fabulator::Template::Taggable

Included in:
Parser, StandardTags
Defined in:
lib/fabulator/template/taggable.rb

Defined Under Namespace

Modules: ClassMethods, Util

Constant Summary collapse

@@tag_descriptions =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/fabulator/template/taggable.rb', line 19

def self.included(base)
  base.extend(ClassMethods)
  base.module_eval do
    def self.included(new_base)
      super
      new_base.tag_descriptions.merge! self.tag_descriptions
    end
  end
end

.last_descriptionObject



9
10
11
# File 'lib/fabulator/template/taggable.rb', line 9

def self.last_description
  @@last_description
end

.last_description=(l) ⇒ Object



13
14
15
# File 'lib/fabulator/template/taggable.rb', line 13

def self.last_description=(l)
  @@last_description = l
end

.tag_descriptionsObject



5
6
7
# File 'lib/fabulator/template/taggable.rb', line 5

def self.tag_descriptions
  @@tag_descriptions
end

Instance Method Details

#render_tag(name, tag_binding) ⇒ Object



29
30
31
# File 'lib/fabulator/template/taggable.rb', line 29

def render_tag(name, tag_binding)
  send "tag:#{name}", tag_binding
end

#tag_descriptions(hash = nil) ⇒ Object



37
38
39
# File 'lib/fabulator/template/taggable.rb', line 37

def tag_descriptions(hash=nil)
  self.class.tag_descriptions hash
end

#tagsObject



33
34
35
# File 'lib/fabulator/template/taggable.rb', line 33

def tags
  Util.tags_in_array(methods)
end