A
aidy
Instead of doing this:
Class Times
def set_time_in_seconds
t = Time.now
@int_secs = t.sec.to_s
end
def get_time_in_seconds
@int_secs
end
end
I have decided to do this
attr_reader :int_secs
Class Times
attr_reader :int_secs
def time_in_seconds
t = Time.now
@int_secs = t.sec.to_s
end
end
In an external class do I still need to invoke #time_in_seconds to
access the value of int_secs?
Cheers
Aidy
Class Times
def set_time_in_seconds
t = Time.now
@int_secs = t.sec.to_s
end
def get_time_in_seconds
@int_secs
end
end
I have decided to do this
attr_reader :int_secs
Class Times
attr_reader :int_secs
def time_in_seconds
t = Time.now
@int_secs = t.sec.to_s
end
end
In an external class do I still need to invoke #time_in_seconds to
access the value of int_secs?
Cheers
Aidy