README.md in fugit-1.3.5 vs README.md in fugit-1.3.6
- old
+ new
@@ -230,9 +230,32 @@
p d.to_plain_s # => "2Y2M1D5h3600s"
p Fugit::Duration.parse('1y2M1d4h').to_sec # => 36820800
```
+There is a `#deflate` method
+
+```ruby
+Fugit::Duration.parse(1000).to_plain_s # => "1000s"
+Fugit::Duration.parse(3600).to_plain_s # => "3600s"
+Fugit::Duration.parse(1000).deflate.to_plain_s # => "16m40s"
+Fugit::Duration.parse(3600).deflate.to_plain_s # => "1h"
+
+# or event shorter
+Fugit.parse(1000).deflate.to_plain_s # => "16m40s"
+Fugit.parse(3600).deflate.to_plain_s # => "1h"
+```
+
+There is also an `#inflate` method
+
+```ruby
+Fugit::Duration.parse('1h30m12').inflate.to_plain_s # => "5412s"
+Fugit.parse('1h30m12').inflate.to_plain_s # => "5412s"
+
+Fugit.parse('1h30m12').to_sec # => 5412
+Fugit.parse('1h30m12').to_sec.to_s + 's' # => "5412s"
+```
+
The `to_*_s` methods are also available as class methods:
```ruby
p Fugit::Duration.to_plain_s('1y2M1d4h')
# => "1Y2M1D4h"
p Fugit::Duration.to_iso_s('1y2M1d4h')