Class: Profile
- Inherits:
-
Object
- Object
- Profile
- Defined in:
- lib/profile.rb
Overview
Session or Profile class Allow to switch easily between different configurations.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#terminal_options ⇒ Object
Returns the value of attribute terminal_options.
-
#vte_options ⇒ Object
Returns the value of attribute vte_options.
Instance Method Summary collapse
-
#initialize(terminal_options, vte_options) ⇒ Profile
constructor
A new instance of Profile.
- #load ⇒ Object
-
#save ⇒ Object
TODO : use json.
Constructor Details
#initialize(terminal_options, vte_options) ⇒ Profile
Returns a new instance of Profile.
24 25 26 27 |
# File 'lib/profile.rb', line 24 def initialize(, ) @terminal_options = @vte_options = end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/profile.rb', line 21 def name @name end |
#terminal_options ⇒ Object
Returns the value of attribute terminal_options.
21 22 23 |
# File 'lib/profile.rb', line 21 def @terminal_options end |
#vte_options ⇒ Object
Returns the value of attribute vte_options.
21 22 23 |
# File 'lib/profile.rb', line 21 def @vte_options end |
Instance Method Details
#load ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/profile.rb', line 36 def load # File.open("#{DATA_HOME_DIR}/#{@name}") do |f| # session = Marshal.load(f) # @terminal_options = session.terminal_options # @vte_options = session.vte_options # end end |
#save ⇒ Object
TODO : use json
30 31 32 33 34 |
# File 'lib/profile.rb', line 30 def save # File.open("#{DATA_HOME_DIR}/#{@name}", 'w+') do |f| # Marshal.dump(self, f) # end end |