Module: Steep::TypeConstruction::Types
- Defined in:
- lib/steep/type_construction.rb
Class Method Summary collapse
- .any ⇒ Object
- .array_instance(type) ⇒ Object
- .boolean?(type) ⇒ Boolean
- .hash_instance(key, value) ⇒ Object
- .nil_instance ⇒ Object
- .range_instance(type) ⇒ Object
- .string_instance ⇒ Object
- .symbol_instance ⇒ Object
Class Method Details
.any ⇒ Object
6 7 8 |
# File 'lib/steep/type_construction.rb', line 6 def any AST::Types::Any.new end |
.array_instance(type) ⇒ Object
22 23 24 |
# File 'lib/steep/type_construction.rb', line 22 def array_instance(type) AST::Types::Name.new_instance(name: "::Array", args: [type]) end |
.boolean?(type) ⇒ Boolean
34 35 36 |
# File 'lib/steep/type_construction.rb', line 34 def boolean?(type) type == AST::Types::Name.new_interface(name: :_Boolean) end |
.hash_instance(key, value) ⇒ Object
26 27 28 |
# File 'lib/steep/type_construction.rb', line 26 def hash_instance(key, value) AST::Types::Name.new_instance(name: "::Hash", args: [key, value]) end |
.nil_instance ⇒ Object
14 15 16 |
# File 'lib/steep/type_construction.rb', line 14 def nil_instance AST::Types::Name.new_instance(name: "::NilClass") end |
.range_instance(type) ⇒ Object
30 31 32 |
# File 'lib/steep/type_construction.rb', line 30 def range_instance(type) AST::Types::Name.new_instance(name: "::Range", args: [type]) end |
.string_instance ⇒ Object
18 19 20 |
# File 'lib/steep/type_construction.rb', line 18 def string_instance AST::Types::Name.new_instance(name: "::String") end |
.symbol_instance ⇒ Object
10 11 12 |
# File 'lib/steep/type_construction.rb', line 10 def symbol_instance AST::Types::Name.new_instance(name: "::Symbol") end |