Class: TypedSet
- Inherits:
-
Object
- Object
- TypedSet
- Defined in:
- lib/typed_set.rb
Instance Method Summary collapse
-
#initialize(set) ⇒ TypedSet
constructor
A new instance of TypedSet.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(set) ⇒ TypedSet
Returns a new instance of TypedSet.
9 10 11 |
# File 'lib/typed_set.rb', line 9 def initialize set @set = set end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/typed_set.rb', line 13 def method_missing(method_name, *args) result = [] @set.each do |element| result.push(element.send(method_name, args)) end return result end |