Class: Thunderbird::LocalFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/thunderbird/local_folder.rb

Overview

A local folder is a file containing emails It is not a “live” folder that is sync-able with an online account

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile:, path:) ⇒ LocalFolder

Returns a new instance of LocalFolder.



12
13
14
15
# File 'lib/thunderbird/local_folder.rb', line 12

def initialize(profile:, path:)
  @profile = profile
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/thunderbird/local_folder.rb', line 9

def path
  @path
end

#profileObject (readonly)

Returns the value of attribute profile.



10
11
12
# File 'lib/thunderbird/local_folder.rb', line 10

def profile
  @profile
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/thunderbird/local_folder.rb', line 33

def exists?
  File.exist?(full_path)
end

#full_pathObject



25
26
27
28
29
30
31
# File 'lib/thunderbird/local_folder.rb', line 25

def full_path
  if in_subdirectory?
    File.join(subdirectory.full_path, folder_name)
  else
    path
  end
end

#msf_exists?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/thunderbird/local_folder.rb', line 41

def msf_exists?
  File.exist?(msf_path)
end

#msf_pathObject



37
38
39
# File 'lib/thunderbird/local_folder.rb', line 37

def msf_path
  "#{full_path}.msf"
end

#set_upObject



17
18
19
20
21
22
23
# File 'lib/thunderbird/local_folder.rb', line 17

def set_up
  return false if path_elements.empty?

  return true if !in_subdirectory?

  subdirectory.set_up
end