Class: Doxie::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/doxie/client.rb
Defined Under Namespace
Classes: AuthenticationError, ClientError, Error, ServerError
Constant Summary
collapse
- USERNAME =
'doxie'.freeze
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
15
16
17
18
|
# File 'lib/doxie/client.rb', line 15
def initialize options
@ip = options[:ip] || ''
@password = options[:password] || ''
end
|
Instance Attribute Details
#ip ⇒ Object
Returns the value of attribute ip.
13
14
15
|
# File 'lib/doxie/client.rb', line 13
def ip
@ip
end
|
#password ⇒ Object
Returns the value of attribute password.
13
14
15
|
# File 'lib/doxie/client.rb', line 13
def password
@password
end
|
Instance Method Details
#delete_scan(scan_name) ⇒ Object
48
49
50
|
# File 'lib/doxie/client.rb', line 48
def delete_scan scan_name
delete("/scans#{scan_name}")
end
|
#delete_scans(scan_names) ⇒ Object
52
53
54
|
# File 'lib/doxie/client.rb', line 52
def delete_scans scan_names
post("/scans/delete.json", scan_names)
end
|
#hello ⇒ Object
20
21
22
|
# File 'lib/doxie/client.rb', line 20
def hello
get('/hello.json')
end
|
24
25
26
|
# File 'lib/doxie/client.rb', line 24
def
get('/hello_extra.json')
end
|
#recent_scans ⇒ Object
36
37
38
|
# File 'lib/doxie/client.rb', line 36
def recent_scans
get('/scans/recent.json')
end
|
#restart ⇒ Object
28
29
30
|
# File 'lib/doxie/client.rb', line 28
def restart
get('/restart.json')
end
|
#scan(scan_name, file_name = nil) ⇒ Object
40
41
42
|
# File 'lib/doxie/client.rb', line 40
def scan scan_name, file_name = nil
file "/scans#{scan_name}", file_name
end
|
#scans ⇒ Object
32
33
34
|
# File 'lib/doxie/client.rb', line 32
def scans
get('/scans.json')
end
|
#thumbnail(scan_name, file_name = nil) ⇒ Object
44
45
46
|
# File 'lib/doxie/client.rb', line 44
def thumbnail scan_name, file_name = nil
file "/thumbnails#{scan_name}", file_name
end
|