Class: Diagrams::Point
- Defined in:
- lib/maruku/ext/diagrams/structures.rb
Instance Attribute Summary collapse
-
#aligned ⇒ Object
Returns the value of attribute aligned.
-
#char ⇒ Object
Returns the value of attribute char.
-
#pos ⇒ Object
Returns the value of attribute pos.
-
#v_p ⇒ Object
variables for point position.
Attributes inherited from Sized
Instance Method Summary collapse
-
#initialize ⇒ Point
constructor
A new instance of Point.
- #link_direction(pos, inc) ⇒ Object
Constructor Details
#initialize ⇒ Point
Returns a new instance of Point.
122 123 124 125 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 122 def initialize super() @aligned = {:l=>[],:t=>[]} end |
Instance Attribute Details
#aligned ⇒ Object
Returns the value of attribute aligned.
117 118 119 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 117 def aligned @aligned end |
#char ⇒ Object
Returns the value of attribute char.
115 116 117 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 115 def char @char end |
#pos ⇒ Object
Returns the value of attribute pos.
114 115 116 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 114 def pos @pos end |
#v_p ⇒ Object
variables for point position
120 121 122 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 120 def v_p @v_p end |
Instance Method Details
#link_direction(pos, inc) ⇒ Object
127 128 129 130 131 132 133 |
# File 'lib/maruku/ext/diagrams/structures.rb', line 127 def link_direction(pos, inc) if inc.x > 0 then return :W end if inc.x < 0 then return :E end if inc.y > 0 then return :N end if inc.y < 0 then return :S end raise "Strange #{inc.inspect}: "+self.inspect end |