Sha256: 27dce2b536070eac633f40ab2e184f81e3fc79fcd1cfe5220e0b993ed40e5c27

Contents?: true

Size: 624 Bytes

Versions: 9

Compression:

Stored size: 624 Bytes

Contents

module Nanoc::Int::ProcessingActions
  class Snapshot < Nanoc::Int::ProcessingAction
    # snapshot :before_layout
    # snapshot :before_layout, path: '/about.md'

    attr_reader :snapshot_name
    attr_reader :path

    def initialize(snapshot_name, path)
      @snapshot_name = snapshot_name
      @path = path
    end

    def serialize
      [:snapshot, @snapshot_name, true, @path]
    end

    NONE = Object.new

    def copy(path: NONE)
      self.class.new(@snapshot_name, path.equal?(NONE) ? @path : path)
    end

    def to_s
      "snapshot #{@snapshot_name.inspect}, path: #{@path.inspect}"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nanoc-4.6.1 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.6.0 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.5.4 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.5.3 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.5.2 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.5.1 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.5.0 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.4.7 lib/nanoc/base/entities/processing_actions/snapshot.rb
nanoc-4.4.6 lib/nanoc/base/entities/processing_actions/snapshot.rb