Class: OpenWFE::RestClient
- Inherits:
-
Object
- Object
- OpenWFE::RestClient
- Defined in:
- lib/openwfe/orest/restclient.rb
Overview
A basic REST client for OpenWFE services (control and worklist)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Instance Method Summary collapse
-
#close ⇒ Object
Closes this REST client.
-
#initialize(url, username, password) ⇒ RestClient
constructor
A new instance of RestClient.
Constructor Details
#initialize(url, username, password) ⇒ RestClient
55 56 57 58 59 60 61 |
# File 'lib/openwfe/orest/restclient.rb', line 55 def initialize (url, username, password) split_url(url) @username = username connect(password) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
52 53 54 |
# File 'lib/openwfe/orest/restclient.rb', line 52 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
52 53 54 |
# File 'lib/openwfe/orest/restclient.rb', line 52 def port @port end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
52 53 54 |
# File 'lib/openwfe/orest/restclient.rb', line 52 def resource @resource end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
52 53 54 |
# File 'lib/openwfe/orest/restclient.rb', line 52 def session_id @session_id end |
Instance Method Details
#close ⇒ Object
Closes this REST client
66 67 68 |
# File 'lib/openwfe/orest/restclient.rb', line 66 def close get('endWorkSession', nil, {}) end |