Class: RailroadDiagrams::Skip
- Inherits:
-
DiagramItem
- Object
- DiagramItem
- RailroadDiagrams::Skip
- Defined in:
- lib/railroad_diagrams/skip.rb
Instance Attribute Summary
Attributes inherited from DiagramItem
#attrs, #children, #down, #height, #needs_space, #up, #width
Instance Method Summary collapse
- #format(x, y, width) ⇒ Object
-
#initialize ⇒ Skip
constructor
A new instance of Skip.
- #text_diagram ⇒ Object
- #to_s ⇒ Object
Methods inherited from DiagramItem
#add, #to_str, #walk, #write_svg
Constructor Details
#initialize ⇒ Skip
Returns a new instance of Skip.
5 6 7 8 9 10 |
# File 'lib/railroad_diagrams/skip.rb', line 5 def initialize super('g') @width = 0 @up = 0 @down = 0 end |
Instance Method Details
#format(x, y, width) ⇒ Object
16 17 18 19 |
# File 'lib/railroad_diagrams/skip.rb', line 16 def format(x, y, width) Path.new(x, y).right(width).add(self) self end |
#text_diagram ⇒ Object
21 22 23 24 |
# File 'lib/railroad_diagrams/skip.rb', line 21 def text_diagram line, = TextDiagram.get_parts(['line']) TextDiagram.new(0, 0, [line]) end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/railroad_diagrams/skip.rb', line 12 def to_s 'Skip()' end |