Class: FirefoxJson::Profiles::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/firefox-json/profiles.rb

Overview

Collects methods to access a single profile’s session file

Instance Method Summary collapse

Constructor Details

#initialize(data, ff_path) ⇒ Profile

Returns a new instance of Profile.



9
10
11
12
# File 'lib/firefox-json/profiles.rb', line 9

def initialize(data, ff_path)
  @data = data
  @ff_path = ff_path
end

Instance Method Details

#pathObject



14
15
16
# File 'lib/firefox-json/profiles.rb', line 14

def path
  @path ||= @data['IsRelative'] == 1 ? File.join(@ff_path, @data['Path']) : @data['Path']
end

#recovery_sessionObject



22
23
24
# File 'lib/firefox-json/profiles.rb', line 22

def recovery_session
  Session.recovery(path)
end

#sessionObject



18
19
20
# File 'lib/firefox-json/profiles.rb', line 18

def session
  Session.default(path)
end