Ruby で書くと、
initialize は、constructor

class A
def initialize
@x = 0
end

def f_1
@x = 1
end

def f_2( num )
@x = num
end
end

p a = A.new #<A: @x=0>

a.f_1
p a #<A: @x=1>

a.f_2( 2 )
p a #<A: @x=2>