Module: RBS::Types::Application
- Included in:
- Alias, ClassInstance, Interface
- Defined in:
- lib/rbs/types.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #each_type(&block) ⇒ Object
- #free_variables(set = Set.new) ⇒ Object
- #has_classish_type? ⇒ Boolean
- #has_self_type? ⇒ Boolean
- #hash ⇒ Object
- #to_s(level = 0) ⇒ Object
- #with_nonreturn_void? ⇒ Boolean
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
254 255 256 |
# File 'lib/rbs/types.rb', line 254 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
253 254 255 |
# File 'lib/rbs/types.rb', line 253 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
256 257 258 |
# File 'lib/rbs/types.rb', line 256 def ==(other) other.is_a?(self.class) && other.name == name && other.args == args end |
#each_type(&block) ⇒ Object
282 283 284 285 286 287 288 |
# File 'lib/rbs/types.rb', line 282 def each_type(&block) if block args.each(&block) else enum_for :each_type end end |
#free_variables(set = Set.new) ⇒ Object
266 267 268 269 270 271 272 |
# File 'lib/rbs/types.rb', line 266 def free_variables(set = Set.new) set.tap do args.each do |arg| arg.free_variables(set) end end end |
#has_classish_type? ⇒ Boolean
294 295 296 |
# File 'lib/rbs/types.rb', line 294 def has_classish_type? each_type.any? {|type| type.has_classish_type? } end |
#has_self_type? ⇒ Boolean
290 291 292 |
# File 'lib/rbs/types.rb', line 290 def has_self_type? each_type.any? {|type| type.has_self_type? } end |
#hash ⇒ Object
262 263 264 |
# File 'lib/rbs/types.rb', line 262 def hash name.hash ^ args.hash end |
#to_s(level = 0) ⇒ Object
274 275 276 277 278 279 280 |
# File 'lib/rbs/types.rb', line 274 def to_s(level = 0) if args.empty? name.to_s else "#{name}[#{args.join(", ")}]" end end |