Sha256: b8f89aba79c966efec115be557d257e0caf5e52f184f4cd12bdcc53de705f35e

Contents?: true

Size: 634 Bytes

Versions: 7

Compression:

Stored size: 634 Bytes

Contents

class Shortcode::Presenter

  def initialize(name, attributes, content, additional_attributes)
    @attributes = attributes
    @content = content
    @additional_attributes = additional_attributes
    initialize_custom_presenter(name)
  end

  def content
    @content
  end

  def attributes
    @attributes
  end

  private

    def initialize_custom_presenter(name)
      if Shortcode.presenters.has_key? name.to_sym
        presenter   = Shortcode.presenters[name.to_sym].new(@attributes, @content, @additional_attributes)
        @attributes = presenter.attributes
        @content    = presenter.content
      end
    end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shortcode-0.4.1 lib/shortcode/presenter.rb
shortcode-0.4.0 lib/shortcode/presenter.rb
shortcode-0.3.3 lib/shortcode/presenter.rb
shortcode-0.3.2 lib/shortcode/presenter.rb
shortcode-0.3.1 lib/shortcode/presenter.rb
shortcode-0.3.0 lib/shortcode/presenter.rb
shortcode-0.2.0 lib/shortcode/presenter.rb