Class: DeltaAttack::FiletypeAssumption
- Inherits:
-
Object
- Object
- DeltaAttack::FiletypeAssumption
- Defined in:
- lib/delta_attack/filetype_assumption.rb
Constant Summary collapse
- CONTENT_TYPES =
{ "application/msword" => :word, "application/vnd.ms-excel" => :excel, "application/vnd.ms-powerpoint" => :power_point, }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #content_type ⇒ Object
- #filetype ⇒ Object
-
#initialize(filename, content_type = nil, content = nil) ⇒ FiletypeAssumption
constructor
A new instance of FiletypeAssumption.
Constructor Details
#initialize(filename, content_type = nil, content = nil) ⇒ FiletypeAssumption
Returns a new instance of FiletypeAssumption.
19 20 21 22 23 |
# File 'lib/delta_attack/filetype_assumption.rb', line 19 def initialize(filename, content_type = nil, content = nil) @filename = filename @content_type = content_type @content = content end |
Class Method Details
.support_magic? ⇒ Boolean
15 16 17 |
# File 'lib/delta_attack/filetype_assumption.rb', line 15 def self.support_magic? defined? Mahoro end |
Instance Method Details
#content_type ⇒ Object
29 30 31 |
# File 'lib/delta_attack/filetype_assumption.rb', line 29 def content_type CONTENT_TYPES.index(filetype) end |
#filetype ⇒ Object
25 26 27 |
# File 'lib/delta_attack/filetype_assumption.rb', line 25 def filetype by_content_type || by_extention || :unknown end |