Sha256: ddfa364cc09437bb0c2700f364358a369f0d48ee316138d1286aa1ac5970eb99

Contents?: true

Size: 411 Bytes

Versions: 33

Compression:

Stored size: 411 Bytes

Contents

module Locomotive
  class SnippetPresenter < BasePresenter

    ## properties ##

    properties  :name, :slug, :template
    property    :updated_at, only_getter: true

    ## other getters / setters ##

    def updated_at
      I18n.l(self.__source.updated_at, format: :short)
    end

    ## custom as_json ##

    def as_json_for_html_view
      self.as_json(self.getters - %w(template))
    end

  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
locomotivecms-3.0.0.pre.alpha.3 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.7 app/presenters/locomotive/snippet_presenter.rb
locomotivecms-3.0.0.pre.alpha.2 app/presenters/locomotive/snippet_presenter.rb
locomotivecms-3.0.0.pre.alpha app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.6 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.6.rc2 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.6.rc1 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.5 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.4 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.3 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.2 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.1 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.0 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.0.rc3 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.0.rc2 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.5.0.rc1 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.4.1 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.4.0 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.3.1 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.3.0 app/presenters/locomotive/snippet_presenter.rb