Welcome! This page is using CodeRay 1.1.2.

We currently have 2908 rays in the database.
You can add a New Ray or browse the posted rays by pages.

Page 5, 10 entries

a 3 lines of Ruby 70 Bytes Show Edit Expand
1
2
3
def diameter
  wheels.map { |wheel| wheel.rim + (wheel.tire*2) }
end
a 16 lines of Ruby 307 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
class RevealingRefrences
  attr_reader :wheels

  def initialize(data)
    @wheels = wheelify(data)
  end

  def diameter
    wheels.map { |wheel| wheel.rim + (wheel.tire*2) }
  end

  W...
a 14 lines of Ruby 225 Bytes Show Edit Expand
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次元配列が必要
# @...
a 21 lines of Ruby 383 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
class Gear
  attr_reader :chainring, :cog, ;rim, :tire

  def initialize(chainring, cog, rim, tire)
    @chainring = chainring
    @cog = cog
    @rim = rim
    @tire = tire
  end

  def ...
a 14 lines of Ruby 219 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Gear
  attr_reader :chainring, :cog

  def initialize(chainring, cog)
    @chainring = chainring
    @cog = cog
  end

  def ratio
    chainring / cog.to_f
  end
end

Gear.new(52...
a 15 lines of Ruby 200 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class AccessTest
  public
  def pub
    puts "public_method"
  end

  private
  def priv
    puts "private_method"
  end
end

test_super = AccessTest.new
test_super.pub
test_super.priv
a 15 lines of C 200 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class AccessTest
  public
  def pub
    puts "public_method"
  end

  private
  def priv
    puts "private_method"
  end
end

test_super = AccessTest.new
test_super.pub
test_super.priv
sdasdsadsa 5 lines of C 127 Bytes Show Edit Expand
1
2
3
4
5
docker run --rm \
  -e 'SOURCE_METHOD=VOLUME' \
  -e 'PROJECT_TYPE=JAVA' \
  -v $(pwd)/source:/opt/source  \
aaaa/aaaa init
a 7 lines of Ruby 79 Bytes Show Edit Expand
1
2
3
4
5
6
7
def gear_inches
  ratio * diameter
end

def diameter
  wheel.diameter
end
a 34 lines of Ruby 640 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
class Gear
  attr_reader :chainring, :cog, :rim, :tire
  def initialize(chainring, cog, rim, tire)
    @chainring = chainring
    @cog       = cog
    @rim       = rim
    @tire      = tire
...

Page 5, 10 entries