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?

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

#boundsObject (readonly)

Returns the value of attribute bounds.



570
571
572
# File 'lib/bitescript/mirror.rb', line 570

def bounds
  @bounds
end

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



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

Returns:

  • (Boolean)


575
576
577
# File 'lib/bitescript/mirror.rb', line 575

def type_variable?
  true
end