Sha256: 535cbd916218cfb77343ef58c4e5d409c6cb5160449ded25680b1875dae9f566

Contents?: true

Size: 1.13 KB

Versions: 25

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
  class DependencyGraph
    # @!visibility private
    # @see DependencyGraph#set_payload
    class SetPayload < Action # :nodoc:
      # @!group Action

      # (see Action.action_name)
      def self.action_name
        :set_payload
      end

      # (see Action#up)
      def up(graph)
        vertex = graph.vertex_named(name)
        @old_payload = vertex.payload
        vertex.payload = payload
      end

      # (see Action#down)
      def down(graph)
        graph.vertex_named(name).payload = @old_payload
      end

      # @!group SetPayload

      # @return [String] the name of the vertex
      attr_reader :name

      # @return [Object] the payload for the vertex
      attr_reader :payload

      # Initialize an action to add set the payload for a vertex in a dependency
      # graph
      # @param [String] name the name of the vertex
      # @param [Object] payload the payload for the vertex
      def initialize(name, payload)
        @name = name
        @payload = payload
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
rubygems-update-2.6.14 bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
rubygems-update-2.6.13 bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.4 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.3 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.2 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.1 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.0 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.0.pre.4 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/bundler-1.14.6/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.0.pre.3 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
rubygems-update-2.6.12 bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.0.pre.2 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.15.0.pre.1 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
rubygems-update-2.6.11 bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.14.6 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.14.5 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.14.4 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.14.3 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
rubygems-update-2.6.10 bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
bundler-1.14.2 lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb