Module: Bake::Types
- Defined in:
- lib/bake/types.rb,
lib/bake/types/any.rb,
lib/bake/types/nil.rb,
lib/bake/types/hash.rb,
lib/bake/types/array.rb,
lib/bake/types/float.rb,
lib/bake/types/input.rb,
lib/bake/types/tuple.rb,
lib/bake/types/output.rb,
lib/bake/types/string.rb,
lib/bake/types/symbol.rb,
lib/bake/types/boolean.rb,
lib/bake/types/decimal.rb,
lib/bake/types/integer.rb
Defined Under Namespace
Modules: Boolean, Decimal, Float, Input, Integer, Nil, Output, String, Symbol, Type Classes: Any, Array, Hash, Tuple
Class Method Summary collapse
-
.Any(*types) ⇒ Object
A type constructor.
- .Array(item_type = Any) ⇒ Object
- .Hash(key_type, value_type) ⇒ Object
- .parse(signature) ⇒ Object
- .Tuple(*item_types) ⇒ Object
Class Method Details
.Any(*types) ⇒ Object
A type constructor.
“‘ruby Any(Integer, String) “`
See [Any.initialize](#Bake::Types::Any::initialize).
71 72 73 |
# File 'lib/bake/types/any.rb', line 71 def self.Any(*types) Any.new(types) end |
.Array(item_type = Any) ⇒ Object
41 42 43 |
# File 'lib/bake/types/array.rb', line 41 def self.Array(item_type = Any) Array.new(item_type) end |
.Hash(key_type, value_type) ⇒ Object
38 39 40 |
# File 'lib/bake/types/hash.rb', line 38 def self.Hash(key_type, value_type) Hash.new(key_type, value_type) end |
.parse(signature) ⇒ Object
22 23 24 |
# File 'lib/bake/types.rb', line 22 def self.parse(signature) eval(signature, binding) end |