Class: ArchivePrivateOpen

Inherits:
Archive
  • Object
show all
Defined in:
lib/archive_private_open.rb

Constant Summary collapse

FILE_NAME =
'private'

Constants inherited from Archive

Archive::EXTENSION_FILE, Archive::FILE_PATH_KEYS, Archive::MODE_WRITE, Archive::ROOT_PATH_FILE

Instance Attribute Summary

Attributes inherited from Archive

#name, #path

Instance Method Summary collapse

Methods inherited from Archive

#decode, #encode, #full_name, #set_name

Constructor Details

#initializeArchivePrivateOpen

Returns a new instance of ArchivePrivateOpen.



5
6
7
# File 'lib/archive_private_open.rb', line 5

def initialize
  set_name(FILE_NAME)
end

Instance Method Details

#readObject



9
10
11
12
# File 'lib/archive_private_open.rb', line 9

def read
  file = File.open full_name
  file
end

#write(text) ⇒ Object



14
15
16
17
18
# File 'lib/archive_private_open.rb', line 14

def write(text)
  file = File.open(full_name, Archive::MODE_WRITE)
  file.puts text
  file.close
end