Module: Typor
- Defined in:
- lib/typor.rb,
lib/typor/magic.rb,
lib/typor/version.rb
Overview
Typor Module
Defined Under Namespace
Modules: Magic
Constant Summary collapse
- VERSION =
Version
'1.0.0'
Class Method Summary collapse
-
.data(d) ⇒ String
Get Data Type: Determine MIME Type of Data String.
-
.file(f) ⇒ String
Get File Type: Determines MIME Type of Local File.
Class Method Details
.data(d) ⇒ String
Get Data Type: Determine MIME Type of Data String.
27 28 29 |
# File 'lib/typor.rb', line 27 def self.data d (Magic.detect_magic(d) || []).try :first end |
.file(f) ⇒ String
Get File Type: Determines MIME Type of Local File.
19 20 21 |
# File 'lib/typor.rb', line 19 def self.file f (Magic.detect_magic(File.read(f)) || []).try :first end |