Class: RQRCode::Export::SVG::Edge

Inherits:
Struct
  • Object
show all
Defined in:
lib/rqrcode/export/svg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#directionObject

Returns the value of attribute direction

Returns:

  • (Object)

    the current value of direction



106
107
108
# File 'lib/rqrcode/export/svg.rb', line 106

def direction
  @direction
end

#start_xObject

Returns the value of attribute start_x

Returns:

  • (Object)

    the current value of start_x



106
107
108
# File 'lib/rqrcode/export/svg.rb', line 106

def start_x
  @start_x
end

#start_yObject

Returns the value of attribute start_y

Returns:

  • (Object)

    the current value of start_y



106
107
108
# File 'lib/rqrcode/export/svg.rb', line 106

def start_y
  @start_y
end

Instance Method Details

#end_xObject



107
108
109
110
111
112
113
# File 'lib/rqrcode/export/svg.rb', line 107

def end_x
  case direction
  when :right then start_x + 1
  when :left then start_x - 1
  else start_x
  end
end

#end_yObject



115
116
117
118
119
120
121
# File 'lib/rqrcode/export/svg.rb', line 115

def end_y
  case direction
  when :down then start_y + 1
  when :up then start_y - 1
  else start_y
  end
end