Class: Imap::Backup::Serializer::Files::Path
- Inherits:
-
Data
- Object
- Data
- Imap::Backup::Serializer::Files::Path
- Defined in:
- lib/imap/backup/serializer/files/path.rb
Overview
A Data class representing the path to a folder’s serialized data it contains two elements: the base path and the folder name. The base path is the root path for an account’s backup, and the folder name is the name of the folder within that account. If the folder name is nil, the path represents the base path only.
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#folder_name ⇒ Object
readonly
Returns the value of attribute folder_name.
Instance Method Summary collapse
-
#directory ⇒ String
The directory containing the folder’s serialized data.
-
#to_s ⇒ String
The full path to the folder’s serialized data.
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path
12 13 14 |
# File 'lib/imap/backup/serializer/files/path.rb', line 12 def base_path @base_path end |
#folder_name ⇒ Object (readonly)
Returns the value of attribute folder_name
12 13 14 |
# File 'lib/imap/backup/serializer/files/path.rb', line 12 def folder_name @folder_name end |
Instance Method Details
#directory ⇒ String
Returns the directory containing the folder’s serialized data.
19 20 21 22 23 24 25 |
# File 'lib/imap/backup/serializer/files/path.rb', line 19 def directory if folder_name File.dirname(to_s) else base_path end end |
#to_s ⇒ String
Returns the full path to the folder’s serialized data.
14 15 16 |
# File 'lib/imap/backup/serializer/files/path.rb', line 14 def to_s File.join(base_path, folder_name) end |