Sha256: 12c91a978e5f4026fad4df71e27039b94e23bbda6cf728eee43c0352b35864ab

Contents?: true

Size: 523 Bytes

Versions: 14

Compression:

Stored size: 523 Bytes

Contents

module TypeStation
  class BasePresenter

    def initialize(object, template, options = {})
      @object = object
      @template = template
      @options = options
    end

    private

    def self.presents(name)
      define_method(name) do
        @object
      end
    end

    def h
      @template
    end

    def markdown(text)
      Redcarpet.new(text, :hard_wrap, :filter_html, :autolink).to_html.html_safe
    end

    def method_missing(*args, &block)
      @template.send(*args, &block)
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
type_station-0.7.0 app/presenters/type_station/base_presenter.rb
type_station-0.6.0 app/presenters/type_station/base_presenter.rb
type_station-0.5.4 app/presenters/type_station/base_presenter.rb
type_station-0.5.3 app/presenters/type_station/base_presenter.rb
type_station-0.5.2 app/presenters/type_station/base_presenter.rb
type_station-0.5.1 app/presenters/type_station/base_presenter.rb
type_station-0.4.7 app/presenters/type_station/base_presenter.rb
type_station-0.4.6 app/presenters/type_station/base_presenter.rb
type_station-0.4.5 app/presenters/type_station/base_presenter.rb
type_station-0.4.4 app/presenters/type_station/base_presenter.rb
type_station-0.4.3 app/presenters/type_station/base_presenter.rb
type_station-0.4.2 app/presenters/type_station/base_presenter.rb
type_station-0.4.1 app/presenters/type_station/base_presenter.rb
type_station-0.4.0 app/presenters/type_station/base_presenter.rb