Class: Verizon::SensitivityParameters

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/sensitivity_parameters.rb

Overview

Details for sensitivity parameters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(abnormal_max_value = SKIP, enable_abnormal = SKIP, enable_very_abnormal = SKIP, very_abnormal_max_value = SKIP) ⇒ SensitivityParameters

Returns a new instance of SensitivityParameters.



55
56
57
58
59
60
61
# File 'lib/verizon/models/sensitivity_parameters.rb', line 55

def initialize(abnormal_max_value = SKIP, enable_abnormal = SKIP,
               enable_very_abnormal = SKIP, very_abnormal_max_value = SKIP)
  @abnormal_max_value = abnormal_max_value unless abnormal_max_value == SKIP
  @enable_abnormal = enable_abnormal unless enable_abnormal == SKIP
  @enable_very_abnormal = enable_very_abnormal unless enable_very_abnormal == SKIP
  @very_abnormal_max_value = very_abnormal_max_value unless very_abnormal_max_value == SKIP
end

Instance Attribute Details

#abnormal_max_valueFloat

The maximum value of the threshold in the units being measured.

Returns:

  • (Float)


14
15
16
# File 'lib/verizon/models/sensitivity_parameters.rb', line 14

def abnormal_max_value
  @abnormal_max_value
end

#enable_abnormalTrueClass | FalseClass

If abnormal values are being monitored.<br />true - Monitor for abnormal values<br />false - Do not monitor for abnormal values.

Returns:

  • (TrueClass | FalseClass)


19
20
21
# File 'lib/verizon/models/sensitivity_parameters.rb', line 19

def enable_abnormal
  @enable_abnormal
end

#enable_very_abnormalTrueClass | FalseClass

If very abnormal values are being monitored.<br />true - Monitor for very abnormal values<br />false - Do not monitor for very abnormal values.

Returns:

  • (TrueClass | FalseClass)


24
25
26
# File 'lib/verizon/models/sensitivity_parameters.rb', line 24

def enable_very_abnormal
  @enable_very_abnormal
end

#very_abnormal_max_valueFloat

The maximum value of the threshold in the units being measured.

Returns:

  • (Float)


28
29
30
# File 'lib/verizon/models/sensitivity_parameters.rb', line 28

def very_abnormal_max_value
  @very_abnormal_max_value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/verizon/models/sensitivity_parameters.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  abnormal_max_value =
    hash.key?('abnormalMaxValue') ? hash['abnormalMaxValue'] : SKIP
  enable_abnormal =
    hash.key?('enableAbnormal') ? hash['enableAbnormal'] : SKIP
  enable_very_abnormal =
    hash.key?('enableVeryAbnormal') ? hash['enableVeryAbnormal'] : SKIP
  very_abnormal_max_value =
    hash.key?('veryAbnormalMaxValue') ? hash['veryAbnormalMaxValue'] : SKIP

  # Create object from extracted values.
  SensitivityParameters.new(abnormal_max_value,
                            enable_abnormal,
                            enable_very_abnormal,
                            very_abnormal_max_value)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
38
# File 'lib/verizon/models/sensitivity_parameters.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['abnormal_max_value'] = 'abnormalMaxValue'
  @_hash['enable_abnormal'] = 'enableAbnormal'
  @_hash['enable_very_abnormal'] = 'enableVeryAbnormal'
  @_hash['very_abnormal_max_value'] = 'veryAbnormalMaxValue'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/verizon/models/sensitivity_parameters.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
48
# File 'lib/verizon/models/sensitivity_parameters.rb', line 41

def self.optionals
  %w[
    abnormal_max_value
    enable_abnormal
    enable_very_abnormal
    very_abnormal_max_value
  ]
end