lib/authoraise.rb in authoraise-0.1.2 vs lib/authoraise.rb in authoraise-0.1.3
- old
+ new
@@ -12,11 +12,11 @@
class Check
attr_reader :required_keys
def initialize(required_keys, procedure)
- @required_keys = required_keys.to_set
+ @required_keys = required_keys.to_set.freeze
@procedure = procedure
end
def call(options)
given_keys = options.keys.to_set
@@ -62,9 +62,14 @@
return false
else
raise Error,
"Inconclusive authorization, missing keys: #{missing_keys.to_a}"
end
+ end
+
+ def freeze
+ @checks.freeze
+ super
end
private
def assert_all_keys_match(given_keys)