Class: Collection::Array

Inherits:
Object
  • Object
show all
Includes:
Collection
Defined in:
lib/collection/array.rb

Instance Attribute Summary

Attributes included from Collection

#type_parameter

Instance Method Summary collapse

Methods included from Collection

#==, Array, Set, #add, #clear, #each, #empty?, included, #initialize

Instance Method Details

#itemsObject Also known as: content



5
6
7
# File 'lib/collection/array.rb', line 5

def items
  @items ||= ::Array.new
end

#lastObject



10
11
12
# File 'lib/collection/array.rb', line 10

def last
  items.last
end

#lengthObject Also known as: size



14
15
16
# File 'lib/collection/array.rb', line 14

def length
  count
end