This applies to the precise task, described by luciotbc, in the OP, above.
However, you must understand that the point ‘.’ is referring quite generally to an object, the two colons ‘::’ to a class.
Example
puts "file size is " << File::size(‘/tmp’).to_s
puts "file size is " << File.new(‘/tmp’).size.to_s
produce identical output, while two different methods are employed. The File-class has 1 class-method size() which belongs to an object of class ‘Class’ of the name of File. The File class has also 1 Instance-method size() belonging to each object of class ‘File’.
You can write the second line as
fl = File.new(‘/tmp’)
puts "file size is " << fl.size.to_s
As File::size() is obviously a call to a class-method, you can also write it as File.size and have identical output (where File is an object of type class). The double-colon is though clearer.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.