Module: AWS::Core::Data::MethodMissingProxy
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
94
95
96
97
98
99
100
101
102
103
|
# File 'lib/aws/core/data.rb', line 94
def method_missing *args, &block
if block_given?
return_value = @data.send(*args) do |*values|
yield(*values.flatten.map{|v| Data.cast(v) })
end
Data.cast(return_value)
else
Data.cast(@data.send(*args))
end
end
|
Instance Method Details
#[](index_or_key) ⇒ Object
72
73
74
|
# File 'lib/aws/core/data.rb', line 72
def [] index_or_key
Data.cast(@data[index_or_key])
end
|
#dup ⇒ Object
Also known as:
clone
87
88
89
|
# File 'lib/aws/core/data.rb', line 87
def dup
Data.cast(@data.dup)
end
|
#eql?(other) ⇒ Boolean
Also known as:
==
Returns true if the passed object equals the wrapped array.
78
79
80
81
82
83
84
|
# File 'lib/aws/core/data.rb', line 78
def eql? other
if other.is_a?(MethodMissingProxy)
@data == other._data
else
@data == other
end
end
|