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
See also: String#mime and String#type
10 11 12 |
# File 'lib/magic/core/string.rb', line 10 def magic(flags = Magic::NONE) Magic.open(flags) {|mgc| mgc.buffer(self) } end |
#mime ⇒ Object
call-seq:
string.mime -> string or array
See also: String#magic and String#type
20 21 22 |
# File 'lib/magic/core/string.rb', line 20 def mime magic(Magic::MIME) end |
#type ⇒ Object
call-seq:
string.type -> string or array
See also: String#magic and String#mime
30 31 32 |
# File 'lib/magic/core/string.rb', line 30 def type magic(Magic::MIME_TYPE) end |