Sha256: ec6b57540a37c53b85cdedeb6fb68efe3a27eb44cff683823f2a00c71fdc3555

Contents?: true

Size: 410 Bytes

Versions: 2

Compression:

Stored size: 410 Bytes

Contents

require_relative 'page_finder_service'

module Locomotive
  module Steam

    class ParentFinderService < PageFinderService

      def find(page, fullpath)
        return nil if fullpath.blank?

        decorate do
          if fullpath.strip == 'parent'
            repository.parent_of(page)
          else
            repository.by_fullpath(fullpath)
          end
        end
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locomotivecms_steam-1.0.0.pre.alpha.1 lib/locomotive/steam/services/parent_finder_service.rb
locomotivecms_steam-1.0.0.pre.alpha lib/locomotive/steam/services/parent_finder_service.rb