Class: Morpheus::DashboardInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::DashboardInterface
- Defined in:
- lib/morpheus/api/dashboard_interface.rb
Instance Method Summary collapse
- #dashboard(options = {}) ⇒ Object
- #get(options = {}) ⇒ Object
-
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ DashboardInterface
constructor
A new instance of DashboardInterface.
- #recent_activity(account_id = nil, options = {}) ⇒ Object
Constructor Details
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ DashboardInterface
4 5 6 7 8 9 |
# File 'lib/morpheus/api/dashboard_interface.rb', line 4 def initialize(access_token, refresh_token,expires_at = nil, base_url=nil) @access_token = access_token @refresh_token = refresh_token @base_url = base_url @expires_at = expires_at end |
Instance Method Details
#dashboard(options = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/morpheus/api/dashboard_interface.rb', line 15 def dashboard(={}) url = "#{@base_url}/api/dashboard" headers = { params: {}, authorization: "Bearer #{@access_token}" } headers[:params].merge!() execute(method: :get, url: url, headers: headers) end |
#get(options = {}) ⇒ Object
11 12 13 |
# File 'lib/morpheus/api/dashboard_interface.rb', line 11 def get(={}) dashboard() end |
#recent_activity(account_id = nil, options = {}) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/morpheus/api/dashboard_interface.rb', line 22 def recent_activity(account_id=nil, ={}) url = "#{@base_url}/api/dashboard/recentActivity" headers = { params: {}, authorization: "Bearer #{@access_token}" } headers[:params].merge!() headers[:params]['accountId'] = account_id if account_id execute(method: :get, url: url, headers: headers) end |