Class: VagrantBindfs::Bindfs::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-bindfs/bindfs/folder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hook, source, destination, options = {}) ⇒ Folder

Returns a new instance of Folder.



14
15
16
17
18
19
20
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 14

def initialize(hook, source, destination, options = {})
  @hook         = hook

  @source       = source
  @destination  = destination
  @options      = Bindfs::OptionSet.new(nil, options)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



9
10
11
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 9

def destination
  @destination
end

#hookObject (readonly)

Returns the value of attribute hook.



12
13
14
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 12

def hook
  @hook
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 10

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



8
9
10
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 8

def source
  @source
end

Instance Method Details

#idObject



22
23
24
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 22

def id
  @id ||= Digest::SHA1.new.digest(destination)
end

#merge!(options) ⇒ Object



30
31
32
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 30

def merge!(options)
  @options = @options.merge(options)
end

#reverse_merge!(options) ⇒ Object



26
27
28
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 26

def reverse_merge!(options)
  @options = Bindfs::OptionSet.new(nil, options).merge(@options)
end

#to_version!(version) ⇒ Object



34
35
36
# File 'lib/vagrant-bindfs/bindfs/folder.rb', line 34

def to_version!(version)
  @options = @options.to_version(version)
end