Class: FileMarshal::Writer::File

Inherits:
FileMarshal::Writer show all
Defined in:
lib/file_marshal/writer/file.rb

Instance Attribute Summary collapse

Attributes inherited from FileMarshal::Writer

#attributes

Instance Method Summary collapse

Methods inherited from FileMarshal::Writer

#build, #prepare, #set_time, #write

Constructor Details

#initialize(attributes, path) ⇒ File

Returns a new instance of File.



6
7
8
9
# File 'lib/file_marshal/writer/file.rb', line 6

def initialize(attributes, path)
  @attributes = attributes
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/file_marshal/writer/file.rb', line 4

def path
  @path
end

Instance Method Details

#fileObject



11
12
13
# File 'lib/file_marshal/writer/file.rb', line 11

def file
  @file ||= ::File.new(path, "w+")
end