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?
Constructor Details
#initialize(name) ⇒ TypeVariable
Returns a new instance of TypeVariable.
528 529 530 531 |
# File 'lib/bitescript/mirror.rb', line 528 def initialize(name) @name = name @bounds = [] end |
Instance Attribute Details
#bounds ⇒ Object (readonly)
Returns the value of attribute bounds.
527 528 529 |
# File 'lib/bitescript/mirror.rb', line 527 def bounds @bounds end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
527 528 529 |
# File 'lib/bitescript/mirror.rb', line 527 def name @name end |
Instance Method Details
#to_s ⇒ Object
536 537 538 539 540 541 542 |
# File 'lib/bitescript/mirror.rb', line 536 def to_s result = "#{name}" unless bounds.empty? result << ' extends ' << bounds.map {|b| b.to_s}.join(' & ') end result end |
#type_variable? ⇒ Boolean
532 533 534 |
# File 'lib/bitescript/mirror.rb', line 532 def type_variable? true end |