Module: Schema::AttributeMacro::TypeCheck
- Defined in:
- lib/schema/schema.rb
Class Method Summary collapse
Class Method Details
.call(type, val) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/schema/schema.rb', line 53 def self.call(type, val) return true if val.nil? return true if type.nil? val.is_a?(type) end |
.get(type) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/schema/schema.rb', line 60 def self.get(type) return self if type.nil? result = Reflect.(type, :TypeCheck, ancestors: true, strict: false) if not result.nil? return result.constant else return self end end |