Class: RSC
- Inherits:
-
Object
show all
- Defined in:
- lib/rsc.rb
Defined Under Namespace
Classes: Package
Instance Method Summary
collapse
Constructor Details
#initialize(drb_hostname = 'rse', parent_url = nil, port: '61000') ⇒ RSC
Returns a new instance of RSC.
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/rsc.rb', line 43
def initialize(drb_hostname='rse', parent_url=nil, port: '61000')
@port = port
if parent_url then
@parent_url = parent_url
drb_start(drb_hostname)
end
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
82
83
84
|
# File 'lib/rsc.rb', line 82
def method_missing(method_name, *args)
Package.new @obj, @parent_url, method_name.to_s
end
|
Instance Method Details
#delete(s = nil) ⇒ Object
54
55
56
|
# File 'lib/rsc.rb', line 54
def delete(s=nil)
s ? run_uri(s, :delete) : @obj.delete
end
|
#get(s = nil) ⇒ Object
58
59
60
|
# File 'lib/rsc.rb', line 58
def get(s=nil)
s ? run_uri(s, :get) : @obj.get
end
|
#post(s = nil, val = nil) ⇒ Object
62
63
64
|
# File 'lib/rsc.rb', line 62
def post(s=nil, val=nil)
s ? run_uri(s, :post, value: val) : @obj.post
end
|
#put(s) ⇒ Object
66
67
68
|
# File 'lib/rsc.rb', line 66
def put(s)
s ? run_uri(s, :put, value: val) : @obj.put
end
|
#run_job(package, job, params = {}, *qargs, package_path: nil) ⇒ Object
71
72
73
|
# File 'lib/rsc.rb', line 71
def run_job(package, job, params={}, *qargs, package_path: nil)
@obj.run_job(package, job, params, qargs, package_path)
end
|