Method: Gcode::Line#y

Defined in:
lib/gcode/line.rb

#yFloat?

The Y value of the line, nil if no Y value is present.

Returns:

  • (Float)

    Y value of the line.

  • (nil)

    if no Y value is present.



159
160
161
162
163
164
165
# File 'lib/gcode/line.rb', line 159

def y
  if @y.nil? && !@matches[:y_data].nil?
    @y = @matches[:y_data].to_f
  else
    @y
  end
end