Class: RBS::Types::Record
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
- .new(fields:, location:) ⇒ Record constructor
Instance Attribute Summary
- #fields readonly
- #has_classish_type? ⇒ Boolean readonly
- #has_self_type? ⇒ Boolean readonly
- #location readonly
- #with_nonreturn_void? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new(fields:, location:) ⇒ Record
Instance Attribute Details
#fields (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 518
attr_reader :fields
#has_classish_type? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 596
def has_classish_type? each_type.any? {|type| type.has_classish_type? } end
#has_self_type? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 592
def has_self_type? each_type.any? {|type| type.has_self_type? } end
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 519
attr_reader :location
#with_nonreturn_void? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 600
def with_nonreturn_void? each_type.any? {|type| type.with_nonreturn_void? } end
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#each_type(&block)
[ GitHub ]# File 'lib/rbs/types.rb', line 566
def each_type(&block) if block fields.each_value(&block) else enum_for :each_type end end
#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 530
alias eql? ==
#free_variables(set = Set.new)
[ GitHub ]#hash
[ GitHub ]# File 'lib/rbs/types.rb', line 532
def hash self.class.hash ^ fields.hash end