Class: Filedots::Config
- Inherits:
-
Object
- Object
- Filedots::Config
- Defined in:
- lib/filedots/config.rb
Instance Attribute Summary collapse
-
#links ⇒ Object
Returns the value of attribute links.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #link(source, target = nil) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/filedots/config.rb', line 6 def initialize @links = [] end |
Instance Attribute Details
#links ⇒ Object
Returns the value of attribute links.
4 5 6 |
# File 'lib/filedots/config.rb', line 4 def links @links end |
Instance Method Details
#link(source, target = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/filedots/config.rb', line 10 def link(source, target=nil) if source.is_a?(Array) source.each { |s| link(s) } return end target ||= File.("~/.#{source}") source = File.("#{Dir.pwd}/#{source}") @links << [source, target] end |