Sha256: bae2abe1225ad12a8ed59e21bf52f5b2c0e854dd86764f6b0c427dfa87726bfb

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

# frozen_string_literal: true

module Archangel
  module Liquid
    ##
    # Liquid drops for Archangel
    #
    module Drops
      ##
      # Liquid drop for a Page
      #
      class PageDrop < Archangel::Liquid::Drop
        attributes :published_at, :title

        # Page id as a string
        #
        # @return [String] the id
        #
        def id
          object.id.to_s
        end

        # Page permalink with leading slash
        #
        # @return [String] the permalink
        #
        def permalink
          "/#{object.permalink}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.4.0 lib/archangel/liquid/drops/page_drop.rb