Sha256: 93051fc48782cac3cfaccdee27297f1722bf91d119afcf67b001f8715039bdad

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

require 'fog'
require 'virtus'
require 'pathname'
require 'celluloid'
require 'multi_sync/attributes/pathname'

module MultiSync
  class Target
    include Celluloid
    include Virtus.model(strict: true)

    attribute :target_dir, MultiSync::Attributes::Pathname
    attribute :destination_dir, MultiSync::Attributes::Pathname, default: Pathname.new('')
    attribute :credentials, Hash, default: :default_credentials

    def initialize(*args)
      super
    rescue Virtus::CoercionError => e
      raise ArgumentError, e.message
    end

    private

    def default_credentials
      Marshal.load(Marshal.dump(MultiSync.credentials))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_sync-0.0.4 lib/multi_sync/target.rb