Welcome! This page is using CodeRay 1.1.2.
We currently have
3061 rays
in the database.
You can add a
New Ray
or browse the posted rays by pages.
a |
28 lines
of
Ruby
|
447 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7 |
class Bicycle
attr_reader :size, :chain, :tire_size
def initialize(**opts)
@size = opts[:size]
@chain = opts[:chain] || default_chain
@tire_size = opts[:tire_size] || default... |
|
a |
1 line
of
Java
|
26 Bytes |
Show |
Edit |
Expand |
1 |
System.out.print("Kurwa"); |
|
a |
4 lines
of
Ruby
|
104 Bytes |
Show |
Edit |
Expand |
1
2
3
4 |
puts road_bike.spares
|
|
a |
2 lines
of
Ruby
|
72 Bytes |
Show |
Edit |
Expand |
1
2 |
puts mountain_bike.spares
|
|
a |
6 lines
of
Ruby
|
116 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6 |
class MountainBike < Bicycle
def spares
super.merge(front_shock: front_shock)
end
end |
|
a |
9 lines
of
Ruby
|
172 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
class RoadBike < Bicycle
def spares
{ chain: '11-speed',
tire_size: '23',
tape_color: tape_color }
end
end
|
|
a |
17 lines
of
Ruby
|
251 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
class Bicycle
attr_reader :size
def initialize(**opts)
@size = opts[:size]
end
end
class RoadBike < Bicycle
attr_reader :tape_color
def initialize(**opts)
@tape_col... |
|
a |
5 lines
of
Ruby
|
124 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5 |
road_bike = RoadBike.new(
size: 'M',
tape_color: 'red')
puts road_bike.size |
|
a |
1 line
of
Ruby
|
19 Bytes |
Show |
Edit |
Expand |
|
a |
13 lines
of
Ruby
|
332 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
road_bike = RoadBike.new(
size: 'M',
tape_color: 'red')
road_bike.size
mountain_bike = MountainBike.new(
size: 'S',
... |
|