README.md in binary-1.1.1 vs README.md in binary-1.2.0
- old
+ new
@@ -1,8 +1,8 @@
# Binary
-Very simple gem to convert an integer into a binary representation
+Simple Ruby gem to convert integers into binaries and binaries into integers
## Installation
Add this line to your application's Gemfile:
@@ -32,12 +32,23 @@
```
`Output: "11111100010"`.
Also you can pass an array of integers to the method to get an array of their binary values.
```ruby
-Binary.binary([26,6,1991])
+Binary.binary([[7,9,11])
```
-`Output: ["11010", "110", "11111000111"]`.
+`Output: ["111", "1001", "1011"]`.
+
+You can also convert binaries into integers by calling method `number` as follows:
+```ruby
+Binary.number "11111100010"
+```
+`Output: 2018`.
+
+```ruby
+Binary.number(["111", "1001", "1011"])
+```
+`Output: [7,9,11]`.
Other methods you can use:
```ruby
# number of bits in a number's binary