Class: BiteScript::ASM::Wildcard
- Inherits:
-
GenericTypeMirror
- Object
- GenericTypeMirror
- BiteScript::ASM::Wildcard
- Defined in:
- lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb
Instance Attribute Summary collapse
-
#lower_bound ⇒ Object
readonly
Returns the value of attribute lower_bound.
-
#upper_bound ⇒ Object
readonly
Returns the value of attribute upper_bound.
Instance Method Summary collapse
-
#initialize(upper_bound, lower_bound = nil) ⇒ Wildcard
constructor
A new instance of Wildcard.
- #to_s? ⇒ Boolean
- #wildcard? ⇒ Boolean
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_bound ⇒ Object (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_bound ⇒ Object (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
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
561 562 563 |
# File 'lib/bitescript/mirror.rb', line 561 def wildcard? true end |