Class: Senec::Cloud::Dashboard::Finder
- Inherits:
-
Object
- Object
- Senec::Cloud::Dashboard::Finder
- Defined in:
- lib/senec/cloud/dashboard.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #find(system_id) ⇒ Object
- #first ⇒ Object
-
#initialize(connection) ⇒ Finder
constructor
A new instance of Finder.
Constructor Details
#initialize(connection) ⇒ Finder
Returns a new instance of Finder.
19 20 21 |
# File 'lib/senec/cloud/dashboard.rb', line 19 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
22 23 24 |
# File 'lib/senec/cloud/dashboard.rb', line 22 def connection @connection end |
Instance Method Details
#find(system_id) ⇒ Object
24 25 26 |
# File 'lib/senec/cloud/dashboard.rb', line 24 def find(system_id) Dashboard.new(connection:, system_id:).tap(&:load_data) end |
#first ⇒ Object
28 29 30 |
# File 'lib/senec/cloud/dashboard.rb', line 28 def first find(connection.default_system_id) end |