Module: Ritsu::TemplatePolicies::Overwrite

Instance Method Summary collapse

Instance Method Details

#overwrite_block(block, options = {}) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/ritsu/template_policies.rb', line 37

def overwrite_block(block, options={})
  block.clear_contents
  contents.each do |content|
    if !content.kind_of?(Ritsu::Template)
      block.add_content content
    else
      block.add_content(content.create_block(options))
    end
  end
end

#update_block(block, options = {}) ⇒ Object



48
49
50
# File 'lib/ritsu/template_policies.rb', line 48

def update_block(block, options={})
  overwrite_block(block, options)
end