class Shoulda::Matchers::ActiveRecord::Uniqueness::Namespace
@private
Attributes
Public Class Methods
Source
# File lib/shoulda/matchers/active_record/uniqueness/namespace.rb, line 8 def initialize(constant) @constant = constant end
Public Instance Methods
Source
# File lib/shoulda/matchers/active_record/uniqueness/namespace.rb, line 20 def clear constant.constants.each do |child_constant| constant.__send__(:remove_const, child_constant) end end
Source
# File lib/shoulda/matchers/active_record/uniqueness/namespace.rb, line 12 def has?(name) constant.const_defined?(name) end
Source
# File lib/shoulda/matchers/active_record/uniqueness/namespace.rb, line 16 def set(name, value) constant.const_set(name, value) end
Source
# File lib/shoulda/matchers/active_record/uniqueness/namespace.rb, line 26 def to_s constant.to_s end