Class: TestdroidAPI::Files

Inherits:
CloudResource show all
Defined in:
lib/testdroid_api/files.rb

Instance Method Summary collapse

Methods inherited from CloudResource

#camel_case_it, #delete, #download_file, #inspect, #method_missing, #refresh, #set_up_properties_from, #snake_case_it, #sub_items, #update

Constructor Details

#initialize(uri, client, params = {}) ⇒ Files

Returns a new instance of Files.



3
4
5
6
# File 'lib/testdroid_api/files.rb', line 3

def initialize(uri, client, params= {})
  super uri, client, "files", params
  @uri, @client = uri, client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TestdroidAPI::CloudResource

Instance Method Details

#uploadApplication(filename) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/testdroid_api/files.rb', line 8

def uploadApplication(filename)
  if !File.exist?(filename)
    @client.logger.error("Invalid filename")
    return
  end
  reply = @client.upload("#{@uri}/application", filename)

  Application.new(nil, nil, reply)
end

#uploadData(filename) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/testdroid_api/files.rb', line 18

def uploadData(filename)
  if !File.exist?(filename)
    @client.logger.error("Invalid filename")
    return
  end
  reply = @client.upload("#{@uri}/data", filename)

  Data.new(nil, nil, reply)
end

#uploadTest(filename) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/testdroid_api/files.rb', line 28

def uploadTest(filename)
  if !File.exist?(filename)
    @client.logger.error("Invalid filename")
    return
  end
  reply = @client.upload("#{@uri}/test", filename)

  Test.new(nil, nil, reply)
end