Class: Senec::Cloud::Dashboard::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/senec/cloud/dashboard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#connectionObject (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

#firstObject



28
29
30
# File 'lib/senec/cloud/dashboard.rb', line 28

def first
  find(connection.default_system_id)
end