Class: Plister::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/plister/exporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Exporter

Returns a new instance of Exporter.



5
6
7
# File 'lib/plister/exporter.rb', line 5

def initialize(path = nil)
  @path = path || "/Users/#{Plister.user}/.osx.yml"
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/plister/exporter.rb', line 3

def path
  @path
end

Instance Method Details

#exportObject



9
10
11
# File 'lib/plister/exporter.rb', line 9

def export
  File.write path, to_s
end

#to_sObject



13
14
15
# File 'lib/plister/exporter.rb', line 13

def to_s
  Psych.dump(preferences)
end