Class: Diagrams::Arrow

Inherits:
Sized show all
Defined in:
lib/maruku/ext/diagrams/inspect.rb,
lib/maruku/ext/diagrams/structures.rb

Instance Attribute Summary collapse

Attributes inherited from Sized

#hs, #links, #vs

Instance Method Summary collapse

Methods inherited from Sized

#initialize

Constructor Details

This class inherits a constructor from Diagrams::Sized

Instance Attribute Details

#cap1Object

either nil or the cap



69
70
71
# File 'lib/maruku/ext/diagrams/structures.rb', line 69

def cap1
  @cap1
end

#cap2Object

either nil or the cap



69
70
71
# File 'lib/maruku/ext/diagrams/structures.rb', line 69

def cap2
  @cap2
end

Returns the value of attribute end_link.



71
72
73
# File 'lib/maruku/ext/diagrams/structures.rb', line 71

def end_link
  @end_link
end

#end_posObject

Returns the value of attribute end_pos.



70
71
72
# File 'lib/maruku/ext/diagrams/structures.rb', line 70

def end_pos
  @end_pos
end

#lengthObject

Returns the value of attribute length.



72
73
74
# File 'lib/maruku/ext/diagrams/structures.rb', line 72

def length
  @length
end

#object_endObject

Returns the value of attribute object_end.



73
74
75
# File 'lib/maruku/ext/diagrams/structures.rb', line 73

def object_end
  @object_end
end

#object_startObject

Returns the value of attribute object_start.



73
74
75
# File 'lib/maruku/ext/diagrams/structures.rb', line 73

def object_start
  @object_start
end

Returns the value of attribute start_link.



71
72
73
# File 'lib/maruku/ext/diagrams/structures.rb', line 71

def start_link
  @start_link
end

#start_posObject

Returns the value of attribute start_pos.



70
71
72
# File 'lib/maruku/ext/diagrams/structures.rb', line 70

def start_pos
  @start_pos
end

#typeObject

:S, :NW, :SE, :E



68
69
70
# File 'lib/maruku/ext/diagrams/structures.rb', line 68

def type
  @type
end

#v_endObject

variables for start and end



77
78
79
# File 'lib/maruku/ext/diagrams/structures.rb', line 77

def v_end
  @v_end
end

#v_startObject

variables for start and end



77
78
79
# File 'lib/maruku/ext/diagrams/structures.rb', line 77

def v_start
  @v_start
end

Instance Method Details

#inspectObject



4
5
6
7
8
# File 'lib/maruku/ext/diagrams/inspect.rb', line 4

def inspect
	"Arrow (#{(@cap1||?-).chr},#{(@cap2||?-).chr}) "+
	"from #{@start_link.class} to #{@end_link.class} "+
	" #{@start_pos.inspect} -> #{@end_pos.inspect}"
end

#is_vert?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/maruku/ext/diagrams/structures.rb', line 79

def is_vert?
	start_pos.x == end_pos.x
end