Sha256: 0f48fc265f540238d4137b3e0903043122e8838ec6f00ab55193dfb9c31348fd

Contents?: true

Size: 754 Bytes

Versions: 12

Compression:

Stored size: 754 Bytes

Contents

module Fx
  module CommandRecorder
    # @api private
    class Arguments
      def initialize(args)
        @args = args.freeze
      end

      def function
        @args[0]
      end

      def version
        options[:version]
      end

      def revert_to_version
        options[:revert_to_version]
      end

      def invert_version
        Arguments.new([function, options_for_revert])
      end

      def to_a
        @args.to_a
      end

      private

      def options
        @options ||= @args[1] || {}
      end

      def options_for_revert
        options.clone.tap do |revert_options|
          revert_options[:version] = revert_to_version
          revert_options.delete(:revert_to_version)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fx-0.8.0 lib/fx/command_recorder/arguments.rb
fx-0.7.0 lib/fx/command_recorder/arguments.rb
fx-jets-0.6.3s lib/fx/command_recorder/arguments.rb
fx-0.6.2 lib/fx/command_recorder/arguments.rb
fx-0.6.1 lib/fx/command_recorder/arguments.rb
fx-0.6.0 lib/fx/command_recorder/arguments.rb
fx-0.5.0 lib/fx/command_recorder/arguments.rb
fx-0.4.0 lib/fx/command_recorder/arguments.rb
fx-0.3.1 lib/fx/command_recorder/arguments.rb
fx-0.3.0 lib/fx/command_recorder/arguments.rb
fx-0.2.0 lib/fx/command_recorder/arguments.rb
fx-0.1.0 lib/fx/command_recorder/arguments.rb