Category :

Published on :Feb 14, 2016

This is another thing I learned while watching ruby-tapas video on binary literals. Length of the video was 1m:47s only and I am already writing second blog about the learnings from there!

In this post, we will see binary to octal conversion as shown in the video.

# U  G  O
# rwxrwxrwx
0b111101101

perms = 0b111101101
perms.to_s(8) # => "755"

I will surely add other ways of achieving the same as I find in future. I know you are another wise rubyist there, feel free to share your knowledge in the comments below.

Happy Learning! :)

Loading

Interested In Working Together ?

Over 8 years of industry experience in Game/Frontend
development with special interest.
Book your Consultation
© Prakash Poudel