Class: Senec::Cloud::TechnicalData
- Inherits:
-
Object
- Object
- Senec::Cloud::TechnicalData
- Defined in:
- lib/senec/cloud/technical_data.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) ⇒ TechnicalData
constructor
A new instance of TechnicalData.
- #load_data ⇒ Object
Constructor Details
#initialize(connection: nil, system_id: nil, data: nil) ⇒ TechnicalData
Returns a new instance of TechnicalData.
37 38 39 40 41 42 43 44 45 |
# File 'lib/senec/cloud/technical_data.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/technical_data.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/technical_data.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/technical_data.rb', line 47 def load_data raise 'Data already present!' if @data @system_id ||= connection.default_system_id @data = fetch_data end |