Class: Shart::Target

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

Overview

The Target is where the content will be published.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directory_name, opts = {}) ⇒ Target

Returns a new instance of Target.



12
13
14
15
# File 'lib/shart.rb', line 12

def initialize(directory_name, opts={})
  @directory_name = directory_name
  @storage = Fog::Storage.new(opts)
end

Instance Attribute Details

#directory_nameObject (readonly)

Returns the value of attribute directory_name.



10
11
12
# File 'lib/shart.rb', line 10

def directory_name
  @directory_name
end

Instance Method Details

#directoryObject



21
22
23
# File 'lib/shart.rb', line 21

def directory
  @directory ||= @storage.directories.get(@directory_name)
end

#filesObject



17
18
19
# File 'lib/shart.rb', line 17

def files
  directory.files
end

#sync(source) ⇒ Object



25
26
27
# File 'lib/shart.rb', line 25

def sync(source)
  Sync.new(source, self).run
end