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 ⇒ Object
- #wildcard? ⇒ Boolean
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_bound ⇒ Object (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_bound ⇒ Object (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_s ⇒ Object
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
604 605 606 |
# File 'lib/bitescript/mirror.rb', line 604 def wildcard? true end |