Sha256: 4f9d4fcd4f343b419c4d60b59a5972c59048ea0bc498eaef2aa553cdd037f126
Contents?: true
Size: 821 Bytes
Versions: 41
Compression:
Stored size: 821 Bytes
Contents
class Shortcode::TemplateBinding def initialize(name, attributes=[], content='', additional_attributes=nil) include_helper_modules presenter = Shortcode::Presenter.new name, set_attributes(attributes), content, additional_attributes @name = name @attributes = presenter.attributes @content = presenter.content end # Expose private binding() method for use with erb templates def get_binding binding end private def set_attributes(attributes) hash = {} attributes.each { |o| hash[o[:key].to_sym] = o[:value] } hash end def include_helper_modules return unless Shortcode.configuration.helpers.any? class << self Shortcode.configuration.helpers.each do |helper| include helper end end end end
Version data entries
41 entries across 41 versions & 2 rubygems