Class: LicenseFinder::DecisionApplier
- Inherits:
-
Object
- Object
- LicenseFinder::DecisionApplier
- Defined in:
- lib/license_finder/decision_applier.rb
Instance Attribute Summary collapse
-
#acknowledged ⇒ Object
readonly
Returns the value of attribute acknowledged.
Instance Method Summary collapse
- #any_packages? ⇒ Boolean
-
#initialize(options) ⇒ DecisionApplier
constructor
A new instance of DecisionApplier.
- #restricted ⇒ Object
- #unapproved ⇒ Object
Constructor Details
#initialize(options) ⇒ DecisionApplier
Returns a new instance of DecisionApplier.
5 6 7 8 9 |
# File 'lib/license_finder/decision_applier.rb', line 5 def initialize() @decisions = .fetch(:decisions) @all_packages = .fetch(:packages).to_set + @decisions.packages.to_set @acknowledged = apply_decisions end |
Instance Attribute Details
#acknowledged ⇒ Object (readonly)
Returns the value of attribute acknowledged.
11 12 13 |
# File 'lib/license_finder/decision_applier.rb', line 11 def acknowledged @acknowledged end |
Instance Method Details
#any_packages? ⇒ Boolean
21 22 23 |
# File 'lib/license_finder/decision_applier.rb', line 21 def any_packages? all_packages.any? end |
#restricted ⇒ Object
17 18 19 |
# File 'lib/license_finder/decision_applier.rb', line 17 def restricted acknowledged.select(&:restricted?) end |
#unapproved ⇒ Object
13 14 15 |
# File 'lib/license_finder/decision_applier.rb', line 13 def unapproved acknowledged.reject(&:approved?) end |