Module: AWS::Core::Data::MethodMissingProxy

Included in:
AWS::Core::Data, List
Defined in:
lib/aws/core/data.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (protected)



89
90
91
92
93
94
95
96
97
98
# File 'lib/aws/core/data.rb', line 89

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

#eql?(other) ⇒ Boolean Also known as: ==

Returns true if the passed object equals the wrapped array.

Returns:

  • (Boolean)

    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

#idObject



68
69
70
# File 'lib/aws/core/data.rb', line 68

def id
  self[:id] || self.id  
end