Method: Magic.guess
- Defined in:
- lib/magic.rb
.guess(*args) ⇒ Object
Creates magic database and yields it to the given block
Example
Magic.guess(:mime) { |db| db.buffer("Magic® File™") }
# => "text/plain; charset=utf-8"
72 73 74 75 76 77 |
# File 'lib/magic.rb', line 72 def guess(*args) db = Database.new(*args) result = yield(db) db.close result end |