Class: Typespec::Type
- Inherits:
-
Object
- Object
- Typespec::Type
- Defined in:
- lib/typespec.rb
Overview
…
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type) ⇒ Type
constructor
A new instance of Type.
- #valid?(value) ⇒ Boolean
Constructor Details
#initialize(type) ⇒ Type
Returns a new instance of Type.
25 |
# File 'lib/typespec.rb', line 25 def initialize(type); @type = type; end |
Class Method Details
.[](type) ⇒ Object
26 |
# File 'lib/typespec.rb', line 26 def self.[](type); self.new(type); end |
Instance Method Details
#valid?(value) ⇒ Boolean
27 |
# File 'lib/typespec.rb', line 27 def valid?(value); value.is_a?(@type); end |