class Sortviz::Algorithms
Public Class Methods
define(algorithm_name, &block)
click to toggle source
# File lib/sortviz/algorithms.rb, line 4 def define(algorithm_name, &block) plugins << { display_name: algorithm_name } instance_eval &block end
name(name)
click to toggle source
# File lib/sortviz/algorithms.rb, line 17 def name(name) plugins.last[:name] = name end
plugins()
click to toggle source
# File lib/sortviz/algorithms.rb, line 9 def plugins @plugins ||= [] end
sort(block)
click to toggle source
# File lib/sortviz/algorithms.rb, line 13 def sort(block) Algorithms.plugins.last[:sort] = block end
url(link)
click to toggle source
# File lib/sortviz/algorithms.rb, line 25 def url(link) plugins.last[:url] = link end