Class: RBI::Sig
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Sig
- Defined in:
- lib/rbi/model.rb
Overview
Sorbet’s sigs
Instance Attribute Summary collapse
-
#allow_incompatible_override ⇒ Object
: bool.
-
#allow_incompatible_override_visibility ⇒ Object
: bool.
-
#checked ⇒ Object
: Symbol?.
-
#is_abstract ⇒ Object
: bool.
-
#is_final ⇒ Object
: bool.
-
#is_overridable ⇒ Object
: bool.
-
#is_override ⇒ Object
: bool.
-
#params ⇒ Object
readonly
: Array.
-
#return_type ⇒ Object
: (Type | String).
-
#type_params ⇒ Object
readonly
: Array.
-
#without_runtime ⇒ Object
: bool.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#<<(param) ⇒ Object
: (SigParam param) -> void.
-
#==(other) ⇒ Object
: (Object other) -> bool.
-
#add_param(name, type) ⇒ Object
: (String name, (Type | String) type) -> void.
-
#initialize(params: [], return_type: "void", is_abstract: false, is_override: false, is_overridable: false, is_final: false, allow_incompatible_override: false, allow_incompatible_override_visibility: false, without_runtime: false, type_params: [], checked: nil, loc: nil, comments: [], &block) ⇒ Sig
constructor
: ( | ?params: Array, | ?return_type: (Type | String), | ?is_abstract: bool, | ?is_override: bool, | ?is_overridable: bool, | ?is_final: bool, | ?allow_incompatible_override: bool, | ?allow_incompatible_override_visibility: bool, | ?without_runtime: bool, | ?type_params: Array, | ?checked: Symbol?, | ?loc: Loc?, | ?comments: Array | ) ?{ (Sig node) -> void } -> void.
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#compatible_with?, #detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(params: [], return_type: "void", is_abstract: false, is_override: false, is_overridable: false, is_final: false, allow_incompatible_override: false, allow_incompatible_override_visibility: false, without_runtime: false, type_params: [], checked: nil, loc: nil, comments: [], &block) ⇒ Sig
: ( | ?params: Array, | ?return_type: (Type | String), | ?is_abstract: bool, | ?is_override: bool, | ?is_overridable: bool, | ?is_final: bool, | ?allow_incompatible_override: bool, | ?allow_incompatible_override_visibility: bool, | ?without_runtime: bool, | ?type_params: Array, | ?checked: Symbol?, | ?loc: Loc?, | ?comments: Array | ) ?{ (Sig node) -> void } -> void
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 |
# File 'lib/rbi/model.rb', line 926 def initialize( params: [], return_type: "void", is_abstract: false, is_override: false, is_overridable: false, is_final: false, allow_incompatible_override: false, allow_incompatible_override_visibility: false, without_runtime: false, type_params: [], checked: nil, loc: nil, comments: [], &block ) super(loc: loc, comments: comments) @params = params @return_type = return_type @is_abstract = is_abstract @is_override = is_override @is_overridable = is_overridable @is_final = is_final @allow_incompatible_override = allow_incompatible_override @allow_incompatible_override_visibility = allow_incompatible_override_visibility @without_runtime = without_runtime @type_params = type_params @checked = checked block&.call(self) end |
Instance Attribute Details
#allow_incompatible_override ⇒ Object
: bool
897 898 899 |
# File 'lib/rbi/model.rb', line 897 def allow_incompatible_override @allow_incompatible_override end |
#allow_incompatible_override_visibility ⇒ Object
: bool
900 901 902 |
# File 'lib/rbi/model.rb', line 900 def allow_incompatible_override_visibility @allow_incompatible_override_visibility end |
#checked ⇒ Object
: Symbol?
909 910 911 |
# File 'lib/rbi/model.rb', line 909 def checked @checked end |
#is_abstract ⇒ Object
: bool
885 886 887 |
# File 'lib/rbi/model.rb', line 885 def is_abstract @is_abstract end |
#is_final ⇒ Object
: bool
894 895 896 |
# File 'lib/rbi/model.rb', line 894 def is_final @is_final end |
#is_overridable ⇒ Object
: bool
891 892 893 |
# File 'lib/rbi/model.rb', line 891 def is_overridable @is_overridable end |
#is_override ⇒ Object
: bool
888 889 890 |
# File 'lib/rbi/model.rb', line 888 def is_override @is_override end |
#params ⇒ Object (readonly)
: Array
879 880 881 |
# File 'lib/rbi/model.rb', line 879 def params @params end |
#return_type ⇒ Object
: (Type | String)
882 883 884 |
# File 'lib/rbi/model.rb', line 882 def return_type @return_type end |
#type_params ⇒ Object (readonly)
: Array
906 907 908 |
# File 'lib/rbi/model.rb', line 906 def type_params @type_params end |
#without_runtime ⇒ Object
: bool
903 904 905 |
# File 'lib/rbi/model.rb', line 903 def without_runtime @without_runtime end |
Instance Method Details
#<<(param) ⇒ Object
: (SigParam param) -> void
958 959 960 |
# File 'lib/rbi/model.rb', line 958 def <<(param) @params << param end |
#==(other) ⇒ Object
: (Object other) -> bool
968 969 970 971 972 973 974 |
# File 'lib/rbi/model.rb', line 968 def ==(other) return false unless other.is_a?(Sig) params == other.params && return_type.to_s == other.return_type.to_s && is_abstract == other.is_abstract && is_override == other.is_override && is_overridable == other.is_overridable && is_final == other.is_final && without_runtime == other.without_runtime && type_params == other.type_params && checked == other.checked end |