Class: BiteScript::ASM::TypeVariable
- Inherits:
-
GenericTypeMirror
- Object
- GenericTypeMirror
- BiteScript::ASM::TypeVariable
- Defined in:
- lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb
Instance Attribute Summary collapse
-
#bounds ⇒ Object
readonly
Returns the value of attribute bounds.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ TypeVariable
constructor
A new instance of TypeVariable.
- #to_s ⇒ Object
- #type_variable? ⇒ Boolean
Methods inherited from GenericTypeMirror
#array?, #generic_class?, #inspect, #wildcard?
Methods included from Generics
#inspect_generic, #inspect_type
Constructor Details
#initialize(name) ⇒ TypeVariable
Returns a new instance of TypeVariable.
571 572 573 574 |
# File 'lib/bitescript/mirror.rb', line 571 def initialize(name) @name = name @bounds = [] end |
Instance Attribute Details
#bounds ⇒ Object (readonly)
Returns the value of attribute bounds.
570 571 572 |
# File 'lib/bitescript/mirror.rb', line 570 def bounds @bounds end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
570 571 572 |
# File 'lib/bitescript/mirror.rb', line 570 def name @name end |
Instance Method Details
#to_s ⇒ Object
579 580 581 582 583 584 585 |
# File 'lib/bitescript/mirror.rb', line 579 def to_s result = "#{name}" unless bounds.empty? result << ' extends ' << bounds.map {|b| b.to_s}.join(' & ') end result end |
#type_variable? ⇒ Boolean
575 576 577 |
# File 'lib/bitescript/mirror.rb', line 575 def type_variable? true end |