Class: MistApi::Anomaly
- Defined in:
- lib/mist_api/models/anomaly.rb
Overview
Anomaly
Instance Attribute Summary collapse
-
#events ⇒ Array[String]
TODO: Write general description for this method.
-
#since ⇒ Float
TODO: Write general description for this method.
-
#sle_baseline ⇒ Float
TODO: Write general description for this method.
-
#sle_deviation ⇒ Float
TODO: Write general description for this method.
-
#timestamp ⇒ Float
Epoch (seconds).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(events = nil, sle_baseline = nil, sle_deviation = nil, timestamp = nil, since = SKIP) ⇒ Anomaly
constructor
A new instance of Anomaly.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(events = nil, sle_baseline = nil, sle_deviation = nil, timestamp = nil, since = SKIP) ⇒ Anomaly
Returns a new instance of Anomaly.
55 56 57 58 59 60 61 62 |
# File 'lib/mist_api/models/anomaly.rb', line 55 def initialize(events = nil, sle_baseline = nil, sle_deviation = nil, = nil, since = SKIP) @events = events @since = since unless since == SKIP @sle_baseline = sle_baseline @sle_deviation = sle_deviation @timestamp = end |
Instance Attribute Details
#events ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/anomaly.rb', line 14 def events @events end |
#since ⇒ Float
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/anomaly.rb', line 18 def since @since end |
#sle_baseline ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/anomaly.rb', line 22 def sle_baseline @sle_baseline end |
#sle_deviation ⇒ Float
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/anomaly.rb', line 26 def sle_deviation @sle_deviation end |
#timestamp ⇒ Float
Epoch (seconds)
30 31 32 |
# File 'lib/mist_api/models/anomaly.rb', line 30 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/anomaly.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. events = hash.key?('events') ? hash['events'] : nil sle_baseline = hash.key?('sle_baseline') ? hash['sle_baseline'] : nil sle_deviation = hash.key?('sle_deviation') ? hash['sle_deviation'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil since = hash.key?('since') ? hash['since'] : SKIP # Create object from extracted values. Anomaly.new(events, sle_baseline, sle_deviation, , since) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/anomaly.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['events'] = 'events' @_hash['since'] = 'since' @_hash['sle_baseline'] = 'sle_baseline' @_hash['sle_deviation'] = 'sle_deviation' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/mist_api/models/anomaly.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 |
# File 'lib/mist_api/models/anomaly.rb', line 44 def self.optionals %w[ since ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 96 |
# File 'lib/mist_api/models/anomaly.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} events: #{@events.inspect}, since: #{@since.inspect}, sle_baseline:"\ " #{@sle_baseline.inspect}, sle_deviation: #{@sle_deviation.inspect}, timestamp:"\ " #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 88 |
# File 'lib/mist_api/models/anomaly.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} events: #{@events}, since: #{@since}, sle_baseline: #{@sle_baseline},"\ " sle_deviation: #{@sle_deviation}, timestamp: #{@timestamp}>" end |