Sha256: 0b2891999b77aaa9664175d6d88272d4cc7b0910e7026c21a31a0064e1af8fb3

Contents?: true

Size: 410 Bytes

Versions: 11

Compression:

Stored size: 410 Bytes

Contents

module Locomotive
  class SnippetPresenter < BasePresenter

    delegate :name, :slug, :template, :to => :source

    def updated_at
      I18n.l(self.source.updated_at, :format => :short)
    end

    def included_methods
      super + %w(name slug template updated_at)
    end

    def as_json_for_html_view
      methods = included_methods.clone - %w(template)
      self.as_json(methods)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
locomotive_cms-2.0.0.rc12 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc11 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc10 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc9 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc8 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc7 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc6 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc5 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc4 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc2 app/presenters/locomotive/snippet_presenter.rb
locomotive_cms-2.0.0.rc1 app/presenters/locomotive/snippet_presenter.rb