Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/magic/core/string.rb
Instance Method Summary collapse
-
#magic(flags = Magic::NONE) ⇒ Object
call-seq: string.magic -> string, array or nil.
-
#mime ⇒ Object
call-seq: string.mime -> string, array or nil.
-
#type ⇒ Object
call-seq: string.type -> string, array or nil.
Instance Method Details
#magic(flags = Magic::NONE) ⇒ Object
call-seq:
string.magic -> string, array or nil
Returns
Example:
See also: String#mime and String#type
39 40 41 42 |
# File 'lib/magic/core/string.rb', line 39 def magic(flags = Magic::NONE) Magic.open(flags) {|mgc| mgc.buffer(self) } rescue Magic::Error end |