Class: RBS::Types::Intersection
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
- .new(types:, location:) ⇒ Intersection constructor
Instance Attribute Summary
- #has_classish_type? ⇒ Boolean readonly
- #has_self_type? ⇒ Boolean readonly
- #location readonly
- #types readonly
- #with_nonreturn_void? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new(types:, location:) ⇒ Intersection
Instance Attribute Details
#has_classish_type? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 841
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 837
def has_self_type? each_type.any? {|type| type.has_self_type? } end
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 771
attr_reader :location
#types (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 770
attr_reader :types
#with_nonreturn_void? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 845
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 814
def each_type(&block) if block types.each(&block) else enum_for :each_type end end
#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 782
alias eql? ==
#free_variables(set = Set.new)
[ GitHub ]#hash
[ GitHub ]# File 'lib/rbs/types.rb', line 784
def hash self.class.hash ^ types.hash end
#map_type(&block)
[ GitHub ]#map_type_name(&block)
[ GitHub ]#sub(s)
[ GitHub ]#to_json(state = _ = nil)
[ GitHub ]#to_s(level = 0)
[ GitHub ]# File 'lib/rbs/types.rb', line 805
def to_s(level = 0) strs = types.map {|ty| ty.to_s(2) } if level > 0 "(#{strs.join(" & ")})" else strs.join(" & ") end end