Module: Radius::Taggable
- Included in:
- Drop
- Defined in:
- lib/radius/template/radius_drop.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #arrays ⇒ Object
- #objects ⇒ Object
- #render_tag(name, tag_binding) ⇒ Object
- #return_array(name, tag_binding) ⇒ Object
- #return_object(name, tag_binding) ⇒ Object
- #tags ⇒ Object
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/radius/template/radius_drop.rb', line 3 def self.included(base) base.extend(ClassMethods) base.module_eval do protected def params @params ||= request.parameters unless request.nil? end def request_uri @request_url ||= request.request_uri unless request.nil? end end end |
Instance Method Details
#arrays ⇒ Object
33 34 35 |
# File 'lib/radius/template/radius_drop.rb', line 33 def arrays self.methods.grep(/^array:/).map { |name| name[6..-1] }.sort end |
#objects ⇒ Object
37 38 39 |
# File 'lib/radius/template/radius_drop.rb', line 37 def objects self.methods.grep(/^object:/).map { |name| name[7..-1] }.sort end |
#render_tag(name, tag_binding) ⇒ Object
17 18 19 |
# File 'lib/radius/template/radius_drop.rb', line 17 def render_tag(name, tag_binding) send "tag:#{name}", tag_binding end |
#return_array(name, tag_binding) ⇒ Object
21 22 23 |
# File 'lib/radius/template/radius_drop.rb', line 21 def return_array(name, tag_binding) send "array:#{name}", tag_binding end |
#return_object(name, tag_binding) ⇒ Object
25 26 27 |
# File 'lib/radius/template/radius_drop.rb', line 25 def return_object(name, tag_binding) send "object:#{name}", tag_binding end |
#tags ⇒ Object
29 30 31 |
# File 'lib/radius/template/radius_drop.rb', line 29 def self.methods.grep(/^tag:/).map { |name| name[4..-1] }.sort end |