Class: BiteScript::ASM::Wildcard

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, #type_variable?

Methods included from Generics

#inspect_generic, #inspect_type

Constructor Details

#initialize(upper_bound, lower_bound = nil) ⇒ Wildcard

Returns a new instance of Wildcard.



600
601
602
603
# File 'lib/bitescript/mirror.rb', line 600

def initialize(upper_bound, lower_bound=nil)
  @upper_bound = upper_bound
  @lower_bound = lower_bound
end

Instance Attribute Details

#lower_boundObject (readonly)

Returns the value of attribute lower_bound.



599
600
601
# File 'lib/bitescript/mirror.rb', line 599

def lower_bound
  @lower_bound
end

#upper_boundObject (readonly)

Returns the value of attribute upper_bound.



599
600
601
# File 'lib/bitescript/mirror.rb', line 599

def upper_bound
  @upper_bound
end

Instance Method Details

#to_sObject



607
608
609
610
611
612
613
614
615
# File 'lib/bitescript/mirror.rb', line 607

def to_s
  if lower_bound
    "? super #{inspect_type(lower_bound)}"
  elsif upper_bound
    "? extends #{inspect_type(upper_bound)}"
  else
    "?"
  end
end

#wildcard?Boolean

Returns:

  • (Boolean)


604
605
606
# File 'lib/bitescript/mirror.rb', line 604

def wildcard?
  true
end