Class: CasRestClient
- Inherits:
-
Object
- Object
- CasRestClient
- Defined in:
- lib/cas_rest_client/cas_rest_client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{:use_cookies => true}
Instance Method Summary collapse
- #delete(uri, options = {}) ⇒ Object
- #get(uri, options = {}) ⇒ Object
-
#initialize(cas_opts = {}) ⇒ CasRestClient
constructor
A new instance of CasRestClient.
- #post(uri, params = {}, options = {}) ⇒ Object
- #put(uri, params = {}, options = {}) ⇒ Object
Constructor Details
#initialize(cas_opts = {}) ⇒ CasRestClient
Returns a new instance of CasRestClient.
8 9 10 11 12 13 14 15 16 |
# File 'lib/cas_rest_client/cas_rest_client.rb', line 8 def initialize(cas_opts = {}) @cas_opts = DEFAULT_OPTIONS.merge(get_cas_config).merge(cas_opts) begin get_tgt rescue RestClient::BadRequest => e raise RestClient::Request::Unauthorized.new end end |
Instance Method Details
#delete(uri, options = {}) ⇒ Object
22 23 24 |
# File 'lib/cas_rest_client/cas_rest_client.rb', line 22 def delete(uri, = {}) execute("delete", uri, {}, ) end |
#get(uri, options = {}) ⇒ Object
18 19 20 |
# File 'lib/cas_rest_client/cas_rest_client.rb', line 18 def get(uri, = {}) execute("get", uri, {}, ) end |
#post(uri, params = {}, options = {}) ⇒ Object
26 27 28 |
# File 'lib/cas_rest_client/cas_rest_client.rb', line 26 def post(uri, params = {}, = {}) execute("post", uri, params, ) end |
#put(uri, params = {}, options = {}) ⇒ Object
30 31 32 |
# File 'lib/cas_rest_client/cas_rest_client.rb', line 30 def put(uri, params = {}, = {}) execute("put", uri, params, ) end |