Class: Array

Inherits:
Object show all
Defined in:
lib/cards/extensions.rb

Instance Method Summary collapse

Instance Method Details

#heightsObject



39
40
41
# File 'lib/cards/extensions.rb', line 39

def heights
  map {|c| c.height}
end

#sumObject



29
30
31
32
33
# File 'lib/cards/extensions.rb', line 29

def sum
  s = 0
  each {|i| s += i}
  s
end

#widthsObject



35
36
37
# File 'lib/cards/extensions.rb', line 35

def widths
  map {|c| c.width}
end