Top Level Namespace
- Includes:
- SparkApi::Models
Defined Under Namespace
Modules: SparkApi
Instance Method Summary collapse
- #c ⇒ Object
- #delete(path, options = {}) ⇒ Object
- 
  
    
      #get(path, options = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Straight up HTTP functions y’all!!!. 
- #load_oauth2_session(session_alias = "default") ⇒ Object
- 
  
    
      #persist_sessions!(my_alias = nil)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Enables saving and loading serialized oauth2 sessions for the system user. 
- #post(path, body = nil, options = {}) ⇒ Object
- #put(path, body = nil, options = {}) ⇒ Object
- 
  
    
      #save_oauth2_session!(session_alias = "default")  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Handy session persistence. 
Instance Method Details
#delete(path, options = {}) ⇒ Object
| 63 64 65 | # File 'lib/spark_api/cli/setup.rb', line 63 def delete(path, ={}) c.delete(path, ) end | 
#get(path, options = {}) ⇒ Object
Straight up HTTP functions y’all!!!
| 51 52 53 | # File 'lib/spark_api/cli/setup.rb', line 51 def get(path, ={}) c.get(path, ) end | 
#load_oauth2_session(session_alias = "default") ⇒ Object
| 74 75 76 77 78 | # File 'lib/spark_api/cli/setup.rb', line 74 def load_oauth2_session session_alias = "default" c.oauth2_provider.session = "" rescue => e puts "Unable to find a saved oauth2 session: #{e.}" end | 
#persist_sessions!(my_alias = nil) ⇒ Object
Enables saving and loading serialized oauth2 sessions for the system user.
| 27 28 29 30 31 | # File 'lib/spark_api/cli/oauth2.rb', line 27 def persist_sessions! my_alias = nil warn "Warning: persistent session mode saves access tokens in clear text on the filesystem." SparkApi.client.oauth2_provider.session_alias = my_alias unless my_alias.nil? SparkApi.client.oauth2_provider.persistent_sessions = true end | 
#post(path, body = nil, options = {}) ⇒ Object
| 55 56 57 | # File 'lib/spark_api/cli/setup.rb', line 55 def post(path, body = nil, ={}) c.post(path, body, ) end | 
#put(path, body = nil, options = {}) ⇒ Object
| 59 60 61 | # File 'lib/spark_api/cli/setup.rb', line 59 def put(path, body = nil, ={}) c.put(path, body, ) end | 
#save_oauth2_session!(session_alias = "default") ⇒ Object
Handy session persistence
| 68 69 70 71 72 | # File 'lib/spark_api/cli/setup.rb', line 68 def save_oauth2_session! session_alias = "default" rescue => e puts "Unable to save the oauth2 session: #{e.}" end |