Class: VagrantBindfs::Bindfs::Folder

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Folder.



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

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.



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

def destination
  @destination
end

#hookObject (readonly)

Returns the value of attribute hook.



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

def hook
  @hook
end

#optionsObject (readonly)

Returns the value of attribute options.



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

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



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

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

#merge!(options) ⇒ Object



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

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

#reverse_merge!(options) ⇒ Object



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

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

#to_version!(version) ⇒ Object



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

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