lib/attributor.rb in attributor-4.0.0 vs lib/attributor.rb in attributor-4.0.1
- old
+ new
@@ -43,11 +43,11 @@
klass
end
def self.type_name(type)
- return self.type_name(type.class) unless type.kind_of?(Class)
+ return self.type_name(type.class) unless type.kind_of?(::Class)
type.ancestors.find { |k| k.name && !k.name.empty? }.name
end
def self.humanize_context( context )
@@ -73,11 +73,11 @@
inspection = inspection[0..500]+ "...[truncated]" if inspection.size>500
inspection
end
MODULE_PREFIX = "Attributor\:\:".freeze
- MODULE_PREFIX_REGEX = Regexp.new(MODULE_PREFIX)
+ MODULE_PREFIX_REGEX = ::Regexp.new(MODULE_PREFIX)
require_relative 'attributor/families/numeric'
require_relative 'attributor/families/temporal'
require_relative 'attributor/types/container'
@@ -89,14 +89,16 @@
require_relative 'attributor/types/symbol'
require_relative 'attributor/types/boolean'
require_relative 'attributor/types/time'
require_relative 'attributor/types/date'
require_relative 'attributor/types/date_time'
+ require_relative 'attributor/types/regexp'
require_relative 'attributor/types/float'
require_relative 'attributor/types/collection'
require_relative 'attributor/types/hash'
require_relative 'attributor/types/model'
require_relative 'attributor/types/struct'
+ require_relative 'attributor/types/class'
require_relative 'attributor/types/csv'
require_relative 'attributor/types/ids'