Class: AsReadonly::Array
- Inherits:
-
Array
- Object
- Array
- AsReadonly::Array
show all
- Defined in:
- lib/as_readonly/array.rb
Constant Summary
collapse
- REMOVED =
%w|
<< []= clear concat delete delete_at delete_if
flatten! insert map! pop push reject! replace
reverse! shift slice! sort! uniq! unshift fill
|.each do |method|
undef_method(method)
end
Instance Method Summary
collapse
Methods inherited from Array
#as_readonly
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*params) ⇒ Object
13
14
15
|
# File 'lib/as_readonly/array.rb', line 13
def method_missing(*params)
raise NoMethodError
end
|
Instance Method Details
#respond_to?(method, include_private = false) ⇒ Boolean
17
18
19
20
|
# File 'lib/as_readonly/array.rb', line 17
def respond_to?(method, include_private = false)
return false if REMOVED.include?(method.to_s)
super
end
|