Class: Flare::Tools::Cli::Dump::DefaultDumper
- Defined in:
- lib/flare/tools/cli/dump.rb
Instance Attribute Summary
Attributes inherited from Dumper
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(filepath_or_writable) ⇒ DefaultDumper
constructor
A new instance of DefaultDumper.
- #write(data, key, flag, len, version, expire) ⇒ Object
Constructor Details
#initialize(filepath_or_writable) ⇒ DefaultDumper
Returns a new instance of DefaultDumper.
41 42 43 44 45 46 47 |
# File 'lib/flare/tools/cli/dump.rb', line 41 def initialize filepath_or_writable @output = if filepath_or_writable.kind_of?(String) open(filepath_or_writable, 'w') else filepath_or_writable end end |
Class Method Details
.myname ⇒ Object
38 39 40 |
# File 'lib/flare/tools/cli/dump.rb', line 38 def self.myname "default" end |
Instance Method Details
#close ⇒ Object
51 52 53 |
# File 'lib/flare/tools/cli/dump.rb', line 51 def close @output.close unless @output == STDOUT || @output == STDERR end |
#write(data, key, flag, len, version, expire) ⇒ Object
48 49 50 |
# File 'lib/flare/tools/cli/dump.rb', line 48 def write data, key, flag, len, version, expire @output.puts "#{key} #{flag} #{len} #{version} #{expire} '#{data}'" end |