Class: Mutability::MutableArray

Inherits:
Mutable
  • Object
show all
Defined in:
lib/mutability/mutable_array.rb

Instance Attribute Summary

Attributes inherited from Mutable

#original, #self

Instance Method Summary collapse

Methods inherited from Mutable

#freeze!, #respond_to?, #revert!

Constructor Details

#initialize(*array) ⇒ MutableArray

Returns a new instance of MutableArray.



5
6
7
# File 'lib/mutability/mutable_array.rb', line 5

def initialize(*array)
  super array.flatten    # allow either .new(1,2,3) or .new([1,2,3])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mutability::Mutable