Sha256: 005a1633ad45f82c794a90173586a37cb1348ec6588949ac73c349cf3b40baca

Contents?: true

Size: 980 Bytes

Versions: 8

Compression:

Stored size: 980 Bytes

Contents

module Locomotive
  module Wagon
    module Liquid
      module Drops
        class ContentEntry < Base

          delegate :seo_title, :meta_keywords, :meta_description, :to => '_source'

          def _label
            @_label ||= self._source._label
          end

          def _permalink
            @_source._permalink.try(:parameterize)
          end

          alias :_slug :_permalink

          def next
            self
          end

          def previous
            self
          end

          def errors
            (@_source.errors || []).inject({}) do |memo, name|
              memo[name] = ::I18n.t('errors.messages.blank')
              memo
            end
          end

          def before_method(meth)
            return '' if self._source.nil?

            if not @@forbidden_attributes.include?(meth.to_s)
              self._source.send(meth)
            else
              nil
            end
          end

        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotivecms_wagon-1.3.0 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.2.2 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.2.1 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.2.0 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.1.0 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.0.2 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.0.1 lib/locomotive/wagon/liquid/drops/content_entry.rb
locomotivecms_wagon-1.0.0 lib/locomotive/wagon/liquid/drops/content_entry.rb