Sha256: e7da2d0210ff1724a90f34c45034105085ef3c82bee2be5516c8df435d2d5af3

Contents?: true

Size: 757 Bytes

Versions: 44

Compression:

Stored size: 757 Bytes

Contents

module Redcar
  module Macros
    class ActionSequence
      attr_reader :actions
      attr_reader :skip_length
      
      def initialize(actions, skip_length)
        @actions = actions
        @skip_length = skip_length
      end
      
      def run_in(edit_view, this_skip_length=nil)
        this_skip_length ||= skip_length
        edit_view.document.compound do
          actions[this_skip_length..-1].each do |action|
            case action
            when Fixnum
              edit_view.type_character(action)
            when Symbol
              edit_view.invoke_action(action)
            when DocumentCommand
              action.run(:env => {:edit_view => edit_view})
            end
          end
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
redcar-0.13 plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.5dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.4dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.3dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.2dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.1dev plugins/macros/lib/macros/action_sequence.rb
redcar-0.12.1 plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.13.0dev plugins/macros/lib/macros/action_sequence.rb
redcar-0.12 plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.27dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.26dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.25dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.24dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.23dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.22dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.21dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.20dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.19dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.18dev plugins/macros/lib/macros/action_sequence.rb
redcar-dev-0.12.17dev plugins/macros/lib/macros/action_sequence.rb