a

Ruby code posted
created at 08 May 00:03

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class ObscuringReferences
  attr_reader :data

  def initialize(data)
    @data = data
  end

  def diameters
    data.map { |d| d[0] + (d[1] * 2)}
  end
end

# このクラスの初期化には2次元配列が必要
# @data = [[1,2], [3,4], [5,6]]
225 Bytes in 4 ms with coderay