class PatchworkInternal::Link
Attributes
cost[RW]
directed[RW]
id[R]
node_end[R]
node_start[R]
Public Class Methods
new(node_a, node_b, directed, cost)
click to toggle source
# File lib/patchwork/link.rb, line 8 def initialize(node_a, node_b, directed, cost) @node_start = node_a @node_end = node_b @directed = directed @cost = cost @id = SecureRandom.uuid end
Public Instance Methods
links_to(node)
click to toggle source
# File lib/patchwork/link.rb, line 16 def links_to(node) if @directed == true node == @node_end else node == @node_start || node == @node_end end end