Class: FbUtils::Writer::Base
- Inherits:
-
Object
- Object
- FbUtils::Writer::Base
- Defined in:
- lib/fb_utils/writers/base.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(filename, options = {}) ⇒ Base
constructor
A new instance of Base.
- #write ⇒ Object
Constructor Details
#initialize(filename, options = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 |
# File 'lib/fb_utils/writers/base.rb', line 6 def initialize(filename, ={}) @options = @options[:format] ||= "txt" @filename = File.basename(filename, ".#{[:format]}") + ".#{[:format]}" f = File.new(@filename, "w") f.close end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
4 5 6 |
# File 'lib/fb_utils/writers/base.rb', line 4 def filename @filename end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/fb_utils/writers/base.rb', line 4 def @options end |
Instance Method Details
#write ⇒ Object
14 15 16 |
# File 'lib/fb_utils/writers/base.rb', line 14 def write raise NotImplementedError end |