Class: SFRest::Site_guard
- Inherits:
-
Object
- Object
- SFRest::Site_guard
- Defined in:
- lib/sfrest/site_guard.rb
Overview
We need to keep this naming due to the way connection.rb autoloads things. rubocop: disable Naming/ClassAndModuleCamelCase Manage the site guard feature.
Instance Method Summary collapse
-
#current_settings ⇒ Array
Get current site guard settings.
-
#disable_site_guard ⇒ Array
Removes and disableds the site guard settings.
-
#enable_site_guard(message, username, password) ⇒ Array
Set and enables the site guard settings.
-
#initialize(conn) ⇒ Site_guard
constructor
A new instance of Site_guard.
Constructor Details
#initialize(conn) ⇒ Site_guard
Returns a new instance of Site_guard.
11 12 13 |
# File 'lib/sfrest/site_guard.rb', line 11 def initialize(conn) @conn = conn end |
Instance Method Details
#current_settings ⇒ Array
Get current site guard settings.
18 19 20 |
# File 'lib/sfrest/site_guard.rb', line 18 def current_settings @conn.get('/api/v1/site-guard') end |
#disable_site_guard ⇒ Array
Removes and disableds the site guard settings.
41 42 43 |
# File 'lib/sfrest/site_guard.rb', line 41 def disable_site_guard @conn.delete('/api/v1/site-guard') end |
#enable_site_guard(message, username, password) ⇒ Array
Set and enables the site guard settings.
28 29 30 31 32 33 34 35 36 |
# File 'lib/sfrest/site_guard.rb', line 28 def enable_site_guard(, username, password) payload = { 'message' => , 'username' => username, 'password' => password } @conn.put('/api/v1/site-guard', payload.to_json) end |