Class: Solver
Class Method Summary collapse
Instance Method Summary collapse
- #executable ⇒ Object
-
#initialize(filename) ⇒ Solver
constructor
A new instance of Solver.
- #solver_exists? ⇒ Boolean
- #store_results(variables) ⇒ Object
Constructor Details
#initialize(filename) ⇒ Solver
Returns a new instance of Solver.
2 3 4 5 6 7 |
# File 'lib/solvers/solvers.rb', line 2 def initialize(filename) @filename = filename @outfile = "/tmp/#{executable}-output.txt" raise StandardError.new("Couldn't find solver #{executable}!") if `which #{executable}`.length == 0 @solver_exists = true end |
Class Method Details
.exists? ⇒ Boolean
21 22 23 |
# File 'lib/solvers/solvers.rb', line 21 def self.exists? return `which #{self.executable}`.length != 0 end |
Instance Method Details
#executable ⇒ Object
13 14 15 |
# File 'lib/solvers/solvers.rb', line 13 def executable self.class.executable end |
#solver_exists? ⇒ Boolean
17 18 19 |
# File 'lib/solvers/solvers.rb', line 17 def solver_exists? @solver_exists || false end |
#store_results(variables) ⇒ Object
9 10 11 |
# File 'lib/solvers/solvers.rb', line 9 def store_results(variables) puts "Not yet implemented" end |