Module: Radiant::Taggable

Included in:
DeprecatedTags, Page, StandardTags
Defined in:
lib/radiant/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



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/radiant/taggable.rb', line 7

def self.included(base)
  base.extend(ClassMethods)
  base.module_eval do
    def self.included(new_base)
      super
      new_base.class_eval do
        include ActionController::UrlFor
        default_url_options.update(:controller => "site", :action => "show_page", :only_path => true)
      end
      new_base.tag_descriptions.merge! self.tag_descriptions
    end
    
    protected
      def params
        @params ||= request.parameters unless request.nil?
      end

      def request_uri
        @request_uri ||= request.fullpath unless request.nil?
      end
  end
end

Instance Method Details

#render_tag(name, tag_binding) ⇒ Object



30
31
32
# File 'lib/radiant/taggable.rb', line 30

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

#tag_descriptions(hash = nil) ⇒ Object



38
39
40
# File 'lib/radiant/taggable.rb', line 38

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

#tagsObject



34
35
36
# File 'lib/radiant/taggable.rb', line 34

def tags
  Util.tags_in_array(methods)
end