Class: FileHandlers::Base
- Inherits:
-
Object
- Object
- FileHandlers::Base
show all
- Extended by:
- MemoWise
- Defined in:
- app/lib/file_handlers/base.rb
Direct Known Subclasses
Assimp, F3d, FlockXr, GcodeThumbnailExtractor, IframeTag, ImageTag, Lychee, Rouge, Slic3rFamily, Three, VideoTag
Class Method Summary
collapse
Class Method Details
.can_load?(type) ⇒ Boolean
32
33
34
35
36
37
38
39
40
41
|
# File 'app/lib/file_handlers/base.rb', line 32
def can_load?(type)
case type.class.name
when "String"
type.in? self::INPUT_TYPES.filter_map(&:to_s)
when "Symbol"
type.in? self::INPUT_TYPES.filter_map(&:to_sym)
else
type.in? self::INPUT_TYPES
end
end
|
.can_save?(type) ⇒ Boolean
49
50
51
52
53
54
55
56
57
58
|
# File 'app/lib/file_handlers/base.rb', line 49
def can_save?(type)
case type.class.name
when "String"
type.in? self::OUTPUT_TYPES.filter_map(&:to_s)
when "Symbol"
type.in? self::OUTPUT_TYPES.filter_map(&:to_sym)
else
type.in? self::OUTPUT_TYPES
end
end
|
.icon ⇒ Object
23
24
25
|
# File 'app/lib/file_handlers/base.rb', line 23
def icon
nil
end
|
28
29
30
|
# File 'app/lib/file_handlers/base.rb', line 28
def input_types
self::INPUT_TYPES
end
|
.open_url_for(target_url, client_os: nil) ⇒ Object
61
62
63
|
# File 'app/lib/file_handlers/base.rb', line 61
def open_url_for(target_url, client_os: nil)
raise NotImplementedError
end
|
.output_types ⇒ Object
45
46
47
|
# File 'app/lib/file_handlers/base.rb', line 45
def output_types
OUTPUT_TYPES
end
|
.priority ⇒ Object
19
20
21
|
# File 'app/lib/file_handlers/base.rb', line 19
def priority
0
end
|