Class: APDM::Saxo

Inherits:
Object
  • Object
show all
Defined in:
lib/apdm/saxo.rb,
lib/apdm/saxo/iptc.rb,
lib/apdm/saxo/remote.rb,
lib/apdm/saxo/metadata.rb

Defined Under Namespace

Classes: IPTC, InvalidConfig, Metadata, Remote

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Saxo

Returns a new instance of Saxo.



26
27
28
29
30
31
32
33
# File 'lib/apdm/saxo.rb', line 26

def initialize(options = {})
  options.each {|k,v| validate(k, v)}

  self.server = options[:server] || options['server']
  self.username = options[:username] || options['username']
  self.password = options[:password] || options['password']
  self.remote_dir = (options[:remote_dir] || options['remote_dir']).upcase
end

Class Attribute Details

.loggerObject



16
17
18
19
20
21
22
# File 'lib/apdm/saxo.rb', line 16

def logger
  unless @logger
    FileUtils.mkdir('log') unless File.exists?('log')
    @logger = Logger.new('log/saxo.log')
  end
  @logger
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#remote_dirObject

Returns the value of attribute remote_dir.



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

def remote_dir
  @remote_dir
end

#serverObject

Returns the value of attribute server.



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

def server
  @server
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#transfer(photo) ⇒ Object



39
40
41
# File 'lib/apdm/saxo.rb', line 39

def transfer(photo)
  Remote.new(self, photo).transfer
end

#write(metadata) ⇒ Object



35
36
37
# File 'lib/apdm/saxo.rb', line 35

def write()
  Metadata.new()
end