Class: Contracts::Constraints::Type
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(type) ⇒ Type
constructor
A new instance of Type.
- #matches?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(type) ⇒ Type
Returns a new instance of Type.
208 |
# File 'lib/contracts.rb', line 208 def initialize(type) = @type = type |
Instance Method Details
#description ⇒ Object
210 |
# File 'lib/contracts.rb', line 210 def description = @type.is_a?(Module) ? @type.name : @type.to_s |
#matches?(value) ⇒ Boolean
209 |
# File 'lib/contracts.rb', line 209 def matches?(value) = value.is_a?(@type) |