Class: SFRP::Poly::DSL::TConstProxy
- Inherits:
-
Object
- Object
- SFRP::Poly::DSL::TConstProxy
- Defined in:
- lib/sfrp/poly/dsl.rb
Instance Method Summary collapse
-
#initialize(tconst_str, var_strs, infinite) ⇒ TConstProxy
constructor
A new instance of TConstProxy.
- #vconst(vconst_str, arg_type_annots, native_str = nil) ⇒ Object
- #vconst_strs ⇒ Object
Constructor Details
#initialize(tconst_str, var_strs, infinite) ⇒ TConstProxy
Returns a new instance of TConstProxy.
64 65 66 67 68 69 70 |
# File 'lib/sfrp/poly/dsl.rb', line 64 def initialize(tconst_str, var_strs, infinite) args = var_strs.map { |v| TypeAnnotationVar.new(v) } @ret_type_annot = TypeAnnotationType.new(tconst_str, args) @var_strs = var_strs @infinite = infinite @vconst_strs = [] end |
Instance Method Details
#vconst(vconst_str, arg_type_annots, native_str = nil) ⇒ Object
72 73 74 75 76 |
# File 'lib/sfrp/poly/dsl.rb', line 72 def vconst(vconst_str, arg_type_annots, native_str = nil) ftype_annot = FuncTypeAnnotation.new(@ret_type_annot, arg_type_annots) @vconst_strs << vconst_str VConst.new(vconst_str, @var_strs, ftype_annot, native_str) end |
#vconst_strs ⇒ Object
78 79 80 |
# File 'lib/sfrp/poly/dsl.rb', line 78 def vconst_strs @infinite ? nil : @vconst_strs end |