Class: Plaintext::FileHandler
- Inherits:
-
Object
- Object
- Plaintext::FileHandler
- Defined in:
- lib/plaintext/file_handler.rb
Direct Known Subclasses
Instance Method Summary collapse
- #accept?(content_type) ⇒ Boolean
-
#set(args = {}) ⇒ Object
use ‘#set(max_size: 1.megabyte)` to give an upper limit of data to be read.
Instance Method Details
#accept?(content_type) ⇒ Boolean
5 6 7 8 9 10 11 12 13 |
# File 'lib/plaintext/file_handler.rb', line 5 def accept?(content_type) if @content_type content_type == @content_type elsif @content_types @content_types.include? content_type else false end end |
#set(args = {}) ⇒ Object
use ‘#set(max_size: 1.megabyte)` to give an upper limit of data to be read.
By default, all data (whole file / command output) will be read which can be a problem with huge text files (eg SQL dumps)
19 20 21 22 |
# File 'lib/plaintext/file_handler.rb', line 19 def set(args = {}) .update args self end |