Sha256: 279ffe0f749a55c525eeaf8ba54278a5b033f58d28fdfe32dfa39aa179b6e576

Contents?: true

Size: 345 Bytes

Versions: 47

Compression:

Stored size: 345 Bytes

Contents

module PushType
  class Presenter < SimpleDelegator

    attr_reader :model

    def initialize(model, view_context = nil)
      @model  = model
      @view   = view_context
      super(@model)
    end

    def helpers
      @view || raise("#{ self.class.name } initiated without view context.")
    end

    alias_method :h, :helpers

  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
push_type_core-0.5.0.alpha.4 lib/push_type/presenter.rb
push_type_core-0.5.0.alpha.3 lib/push_type/presenter.rb
push_type_core-0.5.0.alpha.2 lib/push_type/presenter.rb
push_type_core-0.5.0.alpha.1 lib/push_type/presenter.rb
push_type_core-0.4.0 lib/push_type/presenter.rb
push_type_core-0.4.0.beta.3 lib/push_type/presenter.rb
push_type_core-0.3.3 lib/push_type/presenter.rb