Class: BiteScript::ASM::TypeVariable

Inherits:
GenericTypeMirror show all
Defined in:
lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#boundsObject (readonly)

Returns the value of attribute bounds.



527
528
529
# File 'lib/bitescript/mirror.rb', line 527

def bounds
  @bounds
end

#nameObject (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_sObject



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

Returns:

  • (Boolean)


532
533
534
# File 'lib/bitescript/mirror.rb', line 532

def type_variable?
  true
end