Class: RailsBetterFilters::WeightedTopologicalSort::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-better-filters/weighted_topological_sort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ Edge

Returns a new instance of Edge.



82
83
84
85
# File 'lib/rails-better-filters/weighted_topological_sort.rb', line 82

def initialize(from, to)
  @from = from
  @to = to
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



80
81
82
# File 'lib/rails-better-filters/weighted_topological_sort.rb', line 80

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



80
81
82
# File 'lib/rails-better-filters/weighted_topological_sort.rb', line 80

def to
  @to
end

Instance Method Details

#from?(node) ⇒ Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/rails-better-filters/weighted_topological_sort.rb', line 91

def from?(node)
  @from == node.name
end

#to?(node) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/rails-better-filters/weighted_topological_sort.rb', line 87

def to?(node)
  @to == node.name
end