module TumblrThemer::TagHelper::ClassMethods
Public Instance Methods
block(name, data_name=nil, &blk)
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 65 def block name, data_name=nil, &blk blk ||= Proc.new { boolify(data[data_name||underscore(name)]) } blocks[name] = blk end
block_tag(name, data_name=nil)
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 70 def block_tag name, data_name=nil block(name,data_name) tag(name,data_name) end
blocks()
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 61 def blocks @blocks ||= {} end
for_each(name, klass, &blk)
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 53 def for_each name, klass, &blk tag_iterators[name] = {:klass => klass, :blk => blk} end
inherited(subklass)
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 75 def inherited subklass subklass.instance_variable_set(:@tags,@tags.dup) subklass.instance_variable_set(:@blocks,@blocks.dup) subklass.instance_variable_set(:@tag_iterators,@tag_iterators.dup) end
tag(name, data_name=nil, &blk)
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 48 def tag name, data_name=nil, &blk blk ||= Proc.new { data[data_name||underscore(name)] } tags[name] = blk end
tag_iterators()
click to toggle source
# File lib/tumblr-themer/tag_helper.rb, line 57 def tag_iterators @tag_iterators ||= {} end