class Scenic::CommandRecorder::StatementArguments
@api private
Public Class Methods
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 5 def initialize(args) @args = args.freeze end
Public Instance Methods
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 21 def invert_version StatementArguments.new([view, options_for_revert]) end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 25 def remove_version StatementArguments.new([view, options_without_version]) end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 17 def revert_to_version options[:revert_to_version] end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 29 def to_a @args.to_a.dup.delete_if(&:empty?) end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 13 def version options[:version] end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 9 def view @args[0] end
Private Instance Methods
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 39 def keyword_hash(hash) if Hash.respond_to? :ruby2_keywords_hash Hash.ruby2_keywords_hash(hash) else hash end end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 35 def options @options ||= @args[1] || {} end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 47 def options_for_revert opts = options.clone.tap do |revert_options| revert_options[:version] = revert_to_version revert_options.delete(:revert_to_version) end keyword_hash(opts) end
Source
# File lib/scenic/command_recorder/statement_arguments.rb, line 56 def options_without_version keyword_hash(options.except(:version)) end