README.md in format_parser-0.3.1 vs README.md in format_parser-0.3.2
- old
+ new
@@ -39,9 +39,22 @@
```ruby
FormatParser.parse(File.open("myimage", "rb"), natures: [:video, :image], formats: [:jpg, :png, :mp4], results: :all)
```
+If you need format_parser to return JSON, you can use `.as_json` to achieve this:
+
+```ruby
+class Foo
+ include AttributesJSON
+ attr_accessor :number_of_bars
+end
+
+the_foo = Foo.new
+the_foo.number_of_bars = 42
+the_foo.as_json #=> {:number_of_bars => 42}
+```
+
## Creating your own parsers
In order to create new parsers, you have to write a method or a Proc that accepts an IO and performs the
parsing, and then returns the metadata for the file (if it could recover any) or `nil` if it couldn't. All files pass
through all parsers by default, so if you are dealing with a file that is not "your" format - return `nil` from