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.
-
#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.
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, type_params: [], checked: nil, loc: nil, comments: [], &block) ⇒ Sig constructor
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, type_params: [], checked: nil, loc: nil, comments: [], &block) ⇒ Sig
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 |
# File 'lib/rbi/model.rb', line 863 def initialize( params: [], return_type: "void", is_abstract: false, is_override: false, is_overridable: false, is_final: false, allow_incompatible_override: 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 @type_params = type_params @checked = checked block&.call(self) end |
Instance Attribute Details
#allow_incompatible_override ⇒ Object
: bool
854 855 856 |
# File 'lib/rbi/model.rb', line 854 def allow_incompatible_override @allow_incompatible_override end |
#checked ⇒ Object
: Symbol?
860 861 862 |
# File 'lib/rbi/model.rb', line 860 def checked @checked end |
#is_abstract ⇒ Object
: bool
854 855 856 |
# File 'lib/rbi/model.rb', line 854 def is_abstract @is_abstract end |
#is_final ⇒ Object
: bool
854 855 856 |
# File 'lib/rbi/model.rb', line 854 def is_final @is_final end |
#is_overridable ⇒ Object
: bool
854 855 856 |
# File 'lib/rbi/model.rb', line 854 def is_overridable @is_overridable end |
#is_override ⇒ Object
: bool
854 855 856 |
# File 'lib/rbi/model.rb', line 854 def is_override @is_override end |
#params ⇒ Object (readonly)
: Array
848 849 850 |
# File 'lib/rbi/model.rb', line 848 def params @params end |
#return_type ⇒ Object
: (Type | String)
851 852 853 |
# File 'lib/rbi/model.rb', line 851 def return_type @return_type end |
#type_params ⇒ Object (readonly)
: Array
857 858 859 |
# File 'lib/rbi/model.rb', line 857 def type_params @type_params end |
Instance Method Details
#<<(param) ⇒ Object
: (SigParam param) -> void
891 892 893 |
# File 'lib/rbi/model.rb', line 891 def <<(param) @params << param end |
#==(other) ⇒ Object
: (Object other) -> bool
901 902 903 904 905 906 907 |
# File 'lib/rbi/model.rb', line 901 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 && type_params == other.type_params && checked == other.checked end |