Class: Thunderbird::LocalFolder

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

Overview

A local folder is a file containing emails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile, path) ⇒ LocalFolder

Returns a new instance of LocalFolder.



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

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

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/thunderbird/local_folder.rb', line 6

def path
  @path
end

#profileObject (readonly)

Returns the value of attribute profile.



7
8
9
# File 'lib/thunderbird/local_folder.rb', line 7

def profile
  @profile
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/thunderbird/local_folder.rb', line 30

def exists?
  File.exist?(full_path)
end

#full_pathObject



22
23
24
25
26
27
28
# File 'lib/thunderbird/local_folder.rb', line 22

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

#msf_exists?Boolean

Returns:

  • (Boolean)


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

def msf_exists?
  File.exist?(msf_path)
end

#msf_pathObject



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

def msf_path
  "#{path}.msf"
end

#set_upObject



14
15
16
17
18
19
20
# File 'lib/thunderbird/local_folder.rb', line 14

def set_up
  return if path_elements.empty?

  return true if !in_subdirectory?

  subdirectory.set_up
end