Class: DepSelector::Selector
- Inherits:
-
Object
- Object
- DepSelector::Selector
- Defined in:
- lib/dep_selector/selector.rb
Constant Summary collapse
- DEFAULT_ERROR_REPORTER =
ErrorReporter::SimpleTreeTraverser.new
Instance Attribute Summary collapse
-
#dep_graph ⇒ Object
Returns the value of attribute dep_graph.
-
#error_reporter ⇒ Object
Returns the value of attribute error_reporter.
Instance Method Summary collapse
- #find_solution(solution_constraints, valid_packages = nil) ⇒ Object
-
#initialize(dep_graph, error_reporter = DEFAULT_ERROR_REPORTER) ⇒ Selector
constructor
A new instance of Selector.
Constructor Details
#initialize(dep_graph, error_reporter = DEFAULT_ERROR_REPORTER) ⇒ Selector
Returns a new instance of Selector.
36 37 38 39 |
# File 'lib/dep_selector/selector.rb', line 36 def initialize(dep_graph, error_reporter = DEFAULT_ERROR_REPORTER) @dep_graph = dep_graph @error_reporter = error_reporter end |
Instance Attribute Details
#dep_graph ⇒ Object
Returns the value of attribute dep_graph.
32 33 34 |
# File 'lib/dep_selector/selector.rb', line 32 def dep_graph @dep_graph end |
#error_reporter ⇒ Object
Returns the value of attribute error_reporter.
32 33 34 |
# File 'lib/dep_selector/selector.rb', line 32 def error_reporter @error_reporter end |
Instance Method Details
#find_solution(solution_constraints, valid_packages = nil) ⇒ Object
41 42 43 44 |
# File 'lib/dep_selector/selector.rb', line 41 def find_solution(solution_constraints, valid_packages = nil) result = Net::HTTP.post_form(URI('http://devmerlin:9292/'), {selector: self.to_yaml, solution_constraints: solution_constraints.to_yaml, valid_packages: valid_packages.to_yaml}) JSON.parse(result.body) end |