Class: AWS::Core::Data::List
- Inherits:
-
Object
- Object
- AWS::Core::Data::List
- Includes:
- MethodMissingProxy
- Defined in:
- lib/aws/core/data.rb
Instance Method Summary collapse
-
#initialize(array) ⇒ List
constructor
A new instance of List.
-
#inject(*args, &block) ⇒ Object
#inject works on Core::Data::List in in 1.8.7 and 1.9.3, but not in 1.9.2 unless we define it like so.
-
#inspect ⇒ String
Returns the inspection string for the wrapped array.
- #kind_of?(klass) ⇒ Boolean (also: #is_a?)
-
#to_ary ⇒ Array
(also: #to_a)
Returns the contents of this Data::List as a raw array.
Methods included from MethodMissingProxy
Constructor Details
#initialize(array) ⇒ List
Returns a new instance of List.
203 204 205 |
# File 'lib/aws/core/data.rb', line 203 def initialize array @data = array end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AWS::Core::Data::MethodMissingProxy
Instance Method Details
#inject(*args, &block) ⇒ Object
#inject works on Core::Data::List in in 1.8.7 and 1.9.3, but not in 1.9.2 unless we define it like so.
223 224 225 226 227 |
# File 'lib/aws/core/data.rb', line 223 def inject *args, &block @data.inject(*args) do |obj,value| yield(Data.cast(obj),Data.cast(value)) end end |
#inspect ⇒ String
Returns the inspection string for the wrapped array.
209 210 211 |
# File 'lib/aws/core/data.rb', line 209 def inspect @data.inspect end |
#kind_of?(klass) ⇒ Boolean Also known as: is_a?
230 231 232 233 234 235 236 |
# File 'lib/aws/core/data.rb', line 230 def kind_of? klass if klass == Array true else super end end |
#to_ary ⇒ Array Also known as: to_a
Returns the contents of this Data::List as a raw array.
215 216 217 |
# File 'lib/aws/core/data.rb', line 215 def to_ary @data end |