lib/licensee.rb in licensee-9.15.1 vs lib/licensee.rb in licensee-9.15.2
- old
+ new
@@ -22,12 +22,10 @@
# Base domain from which to build license URLs
DOMAIN = 'http://choosealicense.com'
class << self
- attr_writer :confidence_threshold
-
# Returns an array of Licensee::License instances
def licenses(options = {})
Licensee::License.all(options)
end
@@ -48,13 +46,18 @@
def confidence_threshold
@confidence_threshold ||= CONFIDENCE_THRESHOLD
end
+ def confidence_threshold=(value)
+ @confidence_threshold = value
+ @inverse_confidence_threshold = nil
+ end
+
# Inverse of the confidence threshold, represented as a float
# By default this will be 0.02
def inverse_confidence_threshold
@inverse_confidence_threshold ||=
- (1 - Licensee.confidence_threshold / 100.0).round(2)
+ (1 - (Licensee.confidence_threshold / 100.0)).round(2)
end
end
end