Class: Module::EnumeratedType
- Inherits:
-
CompositeType
- Object
- Module
- CompositeType
- Module::EnumeratedType
- Defined in:
- lib/composite_type.rb
Constant Summary
Constants inherited from CompositeType
CompositeType::CACHE, CompositeType::CACHE_MUTEX
Instance Attribute Summary
Attributes inherited from CompositeType
Instance Method Summary collapse
Methods inherited from CompositeType
#initialize, #name, new_cached
Methods inherited from Module
Constructor Details
This class inherits a constructor from Module::CompositeType
Instance Method Details
#===(x) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/composite_type.rb', line 49 def === x Enumerable === x and @_t.size == x.size and begin i = -1 @_t.all?{|t| t === x[i += 1]} end end |
#to_s ⇒ Object
57 58 59 |
# File 'lib/composite_type.rb', line 57 def to_s @to_s ||= "#{@_t[0]}.with(#{@_t[1..-1] * ','})".freeze end |