lib/usable.rb in usable-3.6.0 vs lib/usable.rb in usable-3.6.1
- old
+ new
@@ -10,13 +10,14 @@
def self.extended_constants
@extended_constants ||= Set.new
end
def self.freeze
+ super
extended_constants.each { |const| const.usables.freeze }
extended_constants.freeze
- super
+ self
end
def self.extended(base)
if base.is_a? Class
# Define an instance level version of +usables+
@@ -40,15 +41,17 @@
usables
end
end
end
end
- extended_constants << base
+ extended_constants << base unless Usable.frozen?
end
def inherited(base)
- base.usables += usables
- Usable.extended_constants << base
+ unless Usable.frozen?
+ base.usables += usables
+ Usable.extended_constants << base
+ end
super
end
def usables
@usables ||= Config.new