Class: FutureProof::FutureArray
- Inherits:
-
Object
- Object
- FutureProof::FutureArray
- Includes:
- Enumerable, Exceptionable
- Defined in:
- lib/future_proof/future_array.rb
Instance Method Summary collapse
- #[](index) ⇒ Object
- #all ⇒ Object
- #each ⇒ Object
-
#initialize(arg) ⇒ FutureArray
constructor
A new instance of FutureArray.
Constructor Details
#initialize(arg) ⇒ FutureArray
Returns a new instance of FutureArray.
6 7 8 |
# File 'lib/future_proof/future_array.rb', line 6 def initialize(arg) @arry = Array.new arg end |
Instance Method Details
#[](index) ⇒ Object
10 11 12 |
# File 'lib/future_proof/future_array.rb', line 10 def [](index) raise_or_value @arry[index] end |
#all ⇒ Object
14 15 16 |
# File 'lib/future_proof/future_array.rb', line 14 def all map { |a| a } end |
#each ⇒ Object
24 25 26 |
# File 'lib/future_proof/future_array.rb', line 24 def each @arry.each { |a| yield raise_or_value(a) } end |