Module: Rmega

Defined in:
lib/rmega.rb,
lib/rmega/pool.rb,
lib/rmega/utils.rb,
lib/rmega/errors.rb,
lib/rmega/version.rb,
lib/rmega/session.rb,
lib/rmega/storage.rb,
lib/rmega/options.rb,
lib/rmega/loggable.rb,
lib/rmega/progress.rb,
lib/rmega/nodes/root.rb,
lib/rmega/nodes/node.rb,
lib/rmega/crypto/rsa.rb,
lib/rmega/nodes/file.rb,
lib/rmega/crypto/aes.rb,
lib/rmega/nodes/inbox.rb,
lib/rmega/nodes/trash.rb,
lib/rmega/nodes/folder.rb,
lib/rmega/crypto/crypto.rb,
lib/rmega/nodes/factory.rb,
lib/rmega/crypto/aes_ctr.rb,
lib/rmega/nodes/deletable.rb,
lib/rmega/nodes/uploadable.rb,
lib/rmega/nodes/expandable.rb,
lib/rmega/nodes/traversable.rb,
lib/rmega/nodes/downloadable.rb

Defined Under Namespace

Modules: Crypto, Errors, Loggable, Nodes, Utils Classes: Pool, Progress, Session, Storage

Constant Summary collapse

RequestError =

Backward compatibility

Errors::ServerError
VERSION =
"0.1.7"

Class Method Summary collapse

Class Method Details

.default_optionsObject


4
5
6
7
8
9
10
11
12
# File 'lib/rmega/options.rb', line 4

def self.default_options
  {
    upload_timeout:       120,
    max_retries:          10,
    retry_interval:       1,
    api_request_timeout:  20,
    api_url:              'https://eu.api.mega.co.nz/cs'
  }
end

.loggerObject


5
6
7
8
9
10
11
# File 'lib/rmega/loggable.rb', line 5

def self.logger
  @logger ||= begin
    logger = Logger.new($stdout)
    logger.level = Logger::ERROR
    logger
  end
end

.login(email, password) ⇒ Object


7
8
9
# File 'lib/rmega/session.rb', line 7

def self.(email, password)
  Session.new(email, password).storage
end

.optionsObject


14
15
16
# File 'lib/rmega/options.rb', line 14

def self.options
  @options ||= OpenStruct.new(default_options)
end