Class: Senec::Cloud::Dashboard
- Inherits:
-
Object
- Object
- Senec::Cloud::Dashboard
- Defined in:
- lib/senec/cloud/dashboard.rb
Defined Under Namespace
Classes: Finder
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#system_id ⇒ Object
readonly
Returns the value of attribute system_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(connection: nil, system_id: nil, data: nil) ⇒ Dashboard
constructor
A new instance of Dashboard.
- #load_data ⇒ Object
Constructor Details
#initialize(connection: nil, system_id: nil, data: nil) ⇒ Dashboard
Returns a new instance of Dashboard.
37 38 39 40 41 42 43 44 45 |
# File 'lib/senec/cloud/dashboard.rb', line 37 def initialize(connection: nil, system_id: nil, data: nil) raise ArgumentError unless connection.nil? ^ data.nil? @connection = connection @system_id = system_id # Useful for testing only @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
54 55 56 |
# File 'lib/senec/cloud/dashboard.rb', line 54 def data @data end |
#system_id ⇒ Object (readonly)
Returns the value of attribute system_id.
54 55 56 |
# File 'lib/senec/cloud/dashboard.rb', line 54 def system_id @system_id end |
Class Method Details
Instance Method Details
#load_data ⇒ Object
47 48 49 50 51 52 |
# File 'lib/senec/cloud/dashboard.rb', line 47 def load_data raise 'Data already present!' if @data @system_id ||= connection.default_system_id @data = fetch_data end |