Sha256: 319034ec97d43e848906f482b21b425f5eacb51500e09ef1a59a5aab4cf7056a

Contents?: true

Size: 491 Bytes

Versions: 15

Compression:

Stored size: 491 Bytes

Contents

module TypeStation
  class BasePresenter

    def initialize(object, template)
      @object = object
      @template = template
    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

15 entries across 15 versions & 1 rubygems

Version Path
type_station-0.3.4 app/presenters/type_station/base_presenter.rb
type_station-0.3.3 app/presenters/type_station/base_presenter.rb
type_station-0.3.2 app/presenters/type_station/base_presenter.rb
type_station-0.3.1 app/presenters/type_station/base_presenter.rb
type_station-0.3.0 app/presenters/type_station/base_presenter.rb
type_station-0.2.3 app/presenters/type_station/base_presenter.rb
type_station-0.2.2 app/presenters/type_station/base_presenter.rb
type_station-0.2.1 app/presenters/type_station/base_presenter.rb
type_station-0.2.0 app/presenters/type_station/base_presenter.rb
type_station-0.1.3 app/presenters/type_station/base_presenter.rb
type_station-0.1.1 app/presenters/type_station/base_presenter.rb
type_station-0.0.3 app/presenters/type_station/base_presenter.rb
type_station-0.0.2 app/presenters/type_station/base_presenter.rb
type_station-0.0.1 app/presenters/type_station/base_presenter.rb
type_station-0.0.1.pre app/presenters/type_station/base_presenter.rb