Class: LicenseFinder::DecisionApplier

Inherits:
Object
  • Object
show all
Defined in:
lib/license_finder/decision_applier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options)
  @decisions = options.fetch(:decisions)
  @all_packages = options.fetch(:packages).to_set + @decisions.packages.to_set
  @acknowledged = apply_decisions
end

Instance Attribute Details

#acknowledgedObject (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

Returns:

  • (Boolean)


21
22
23
# File 'lib/license_finder/decision_applier.rb', line 21

def any_packages?
  all_packages.any?
end

#restrictedObject



17
18
19
# File 'lib/license_finder/decision_applier.rb', line 17

def restricted
  acknowledged.select(&:restricted?)
end

#unapprovedObject



13
14
15
# File 'lib/license_finder/decision_applier.rb', line 13

def unapproved
  acknowledged.reject(&:approved?)
end