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?

Constructor Details

#initialize(upper_bound, lower_bound = nil) ⇒ Wildcard

Returns a new instance of Wildcard.



557
558
559
560
# File 'lib/bitescript/mirror.rb', line 557

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.



556
557
558
# File 'lib/bitescript/mirror.rb', line 556

def lower_bound
  @lower_bound
end

#upper_boundObject (readonly)

Returns the value of attribute upper_bound.



556
557
558
# File 'lib/bitescript/mirror.rb', line 556

def upper_bound
  @upper_bound
end

Instance Method Details

#to_s?Boolean

Returns:

  • (Boolean)


564
565
566
567
568
569
570
571
572
# File 'lib/bitescript/mirror.rb', line 564

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

#wildcard?Boolean

Returns:

  • (Boolean)


561
562
563
# File 'lib/bitescript/mirror.rb', line 561

def wildcard?
  true
end