Class: ToSource::Command::Shift

Inherits:
ToSource::Command show all
Defined in:
lib/to_source/command.rb

Overview

Command that does a shift

Constant Summary

Constants inherited from ToSource::Command

NULL

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#widthFixnum (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return shift width

Returns:

  • (Fixnum)


72
73
74
# File 'lib/to_source/command.rb', line 72

def width
  @width
end

Instance Method Details

#run(state) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Run command

Parameters:

Returns:

  • (self)


82
83
84
85
# File 'lib/to_source/command.rb', line 82

def run(state)
  state.shift(width)
  self
end