Class: Literal::Types::DeferredType
- Inherits:
-
Object
- Object
- Literal::Types::DeferredType
- Includes:
- Literal::Type
- Defined in:
- lib/literal/types/deferred_type.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #===(other) ⇒ Object
- #>=(other) ⇒ Object
-
#initialize(&block) ⇒ DeferredType
constructor
A new instance of DeferredType.
- #inspect ⇒ Object
Constructor Details
#initialize(&block) ⇒ DeferredType
Returns a new instance of DeferredType.
6 7 8 |
# File 'lib/literal/types/deferred_type.rb', line 6 def initialize(&block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
10 11 12 |
# File 'lib/literal/types/deferred_type.rb', line 10 def block @block end |
Instance Method Details
#===(other) ⇒ Object
16 17 18 |
# File 'lib/literal/types/deferred_type.rb', line 16 def ===(other) @block.call === other end |
#>=(other) ⇒ Object
20 21 22 |
# File 'lib/literal/types/deferred_type.rb', line 20 def >=(other) Literal.subtype?(other, @block.call) end |
#inspect ⇒ Object
12 13 14 |
# File 'lib/literal/types/deferred_type.rb', line 12 def inspect "_Deferred" end |