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 or array.
-
#mime ⇒ Object
call-seq: string.mime -> string or array.
-
#type ⇒ Object
call-seq: string.type -> string or array.
Instance Method Details
#magic(flags = Magic::NONE) ⇒ Object
call-seq:
string.magic -> string or array
Returns
Example:
See also: String#mime and String#type
39 40 41 |
# File 'lib/magic/core/string.rb', line 39 def magic(flags = Magic::NONE) Magic.open(flags) {|mgc| mgc.buffer(self) } end |
#mime ⇒ Object
call-seq:
string.mime -> string or array
Returns
Example:
See also: String#magic and String#type
53 54 55 |
# File 'lib/magic/core/string.rb', line 53 def mime magic(Magic::MIME) end |
#type ⇒ Object
call-seq:
string.type -> string or array
Returns
Example:
See also: String#magic and String#mime
67 68 69 |
# File 'lib/magic/core/string.rb', line 67 def type magic(Magic::MIME_TYPE) end |