Module: YardTypes
- Extended by:
- YardTypes
- Included in:
- YardTypes
- Defined in:
- lib/yard_types.rb,
lib/yard_types/types.rb,
lib/yard_types/parser.rb,
lib/yard_types/version.rb
Defined Under Namespace
Classes: CollectionType, DuckType, Failure, HashType, KindType, LiteralType, Parser, Result, Success, TupleType, Type, TypeConstraint
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
-
#parse(type) ⇒ TypeConstraint
Parse a type string using the Parser, and return a TypeConstraint instance representing the described type.
- #validate(type, obj) ⇒ Result
Instance Method Details
#parse(type) ⇒ TypeConstraint
Parse a type string using the Parser, and return a TypeConstraint instance representing the described type.
40 41 42 43 |
# File 'lib/yard_types.rb', line 40 def parse(type) type = type.join(', ') if type.respond_to?(:join) Parser.parse(type) end |