Class: Proxies::ArrayProxy
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(*args) ⇒ ArrayProxy
constructor
A new instance of ArrayProxy.
Methods inherited from Base
#==, #__getobj__, #__setobj__, const_missing, #eql?, #method_missing, #proxy?, #respond_to?
Methods included from Stub
Constructor Details
#initialize(*args) ⇒ ArrayProxy
Returns a new instance of ArrayProxy.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bzproxies/array_proxy.rb', line 5 def initialize *args super raise ::ArgumentError, "expected Array, given #{@target.class}" unless @target.kind_of? ::Array unless @proxies.empty? || @target.nil? proxy = @proxies.first @target = @target.map do |i| unless i.respond_to? :stub? proxy.new i, :proxies => @proxies[1..-1], :options => @options else i end end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Proxies::Base