Class: Archive
- Inherits:
-
Object
show all
- Defined in:
- lib/archive.rb
Constant Summary
collapse
- ROOT_PATH_FILE =
"./"
- EXTENSION_FILE =
".txt"
- MODE_WRITE =
"w"
- FILE_PATH_KEYS =
"keys"
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
9
10
11
|
# File 'lib/archive.rb', line 9
def name
@name
end
|
#path ⇒ Object
Returns the value of attribute path.
9
10
11
|
# File 'lib/archive.rb', line 9
def path
@path
end
|
Instance Method Details
#decode(string) ⇒ Object
35
36
37
|
# File 'lib/archive.rb', line 35
def decode(string)
Base64.decode64(string)
end
|
#encode(string) ⇒ Object
31
32
33
|
# File 'lib/archive.rb', line 31
def encode(string)
Base64.encode64(string)
end
|
#full_name ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/archive.rb', line 23
def full_name
if FILE_PATH_KEYS
Dir.mkdir(FILE_PATH_KEYS) unless Dir.exist?(FILE_PATH_KEYS)
end
"#{ FILE_PATH_KEYS + '/' if FILE_PATH_KEYS}#{@name || 'text'}#{EXTENSION_FILE}"
end
|
#read ⇒ Object
11
12
13
|
# File 'lib/archive.rb', line 11
def read
raise "Not implement"
end
|
#set_name(name) ⇒ Object
19
20
21
|
# File 'lib/archive.rb', line 19
def set_name(name)
@name = name
end
|
#write ⇒ Object
15
16
17
|
# File 'lib/archive.rb', line 15
def write
raise "Not implement"
end
|