Class: Verizon::RbsHighPrecisionTiltConfig

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

Overview

RbsHighPrecisionTiltConfig Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(mode: SKIP, periodic_reporting: SKIP, hold_time: SKIP, angle_away: SKIP, angle_toward: SKIP, tscore: SKIP, additional_properties: nil) ⇒ RbsHighPrecisionTiltConfig

Returns a new instance of RbsHighPrecisionTiltConfig.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 66

def initialize(mode: SKIP, periodic_reporting: SKIP, hold_time: SKIP,
               angle_away: SKIP, angle_toward: SKIP, tscore: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @mode = mode unless mode == SKIP
  @periodic_reporting = periodic_reporting unless periodic_reporting == SKIP
  @hold_time = hold_time unless hold_time == SKIP
  @angle_away = angle_away unless angle_away == SKIP
  @angle_toward = angle_toward unless angle_toward == SKIP
  @tscore = tscore unless tscore == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#angle_awayInteger

the threshold value, from verticle, to recognize an event

Returns:

  • (Integer)


27
28
29
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 27

def angle_away
  @angle_away
end

#angle_towardInteger

the threshold value, moving towards verticle, to recognize an event

Returns:

  • (Integer)


31
32
33
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 31

def angle_toward
  @angle_toward
end

#hold_timeInteger

The time the threshold condition exists, in milliseconds, to recognize an event

Returns:

  • (Integer)


23
24
25
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 23

def hold_time
  @hold_time
end

#modeMode

the reporting mode of the tilt sensor

Returns:



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

def mode
  @mode
end

#periodic_reportingPeriodicReporting

The units and values of the time interval for the sensor to send a report

Returns:



18
19
20
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 18

def periodic_reporting
  @periodic_reporting
end

#tscoreTscore

the threshold value, moving towards verticle, to recognize an event

Returns:



35
36
37
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 35

def tscore
  @tscore
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mode = hash.key?('mode') ? hash['mode'] : SKIP
  periodic_reporting = PeriodicReporting.from_hash(hash['periodic-reporting']) if
    hash['periodic-reporting']
  hold_time = hash.key?('hold-time') ? hash['hold-time'] : SKIP
  angle_away = hash.key?('angle-away') ? hash['angle-away'] : SKIP
  angle_toward = hash.key?('angle-toward') ? hash['angle-toward'] : SKIP
  tscore = Tscore.from_hash(hash['tscore']) if hash['tscore']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  RbsHighPrecisionTiltConfig.new(mode: mode,
                                 periodic_reporting: periodic_reporting,
                                 hold_time: hold_time,
                                 angle_away: angle_away,
                                 angle_toward: angle_toward,
                                 tscore: tscore,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
47
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mode'] = 'mode'
  @_hash['periodic_reporting'] = 'periodic-reporting'
  @_hash['hold_time'] = 'hold-time'
  @_hash['angle_away'] = 'angle-away'
  @_hash['angle_toward'] = 'angle-toward'
  @_hash['tscore'] = 'tscore'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 62

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 50

def self.optionals
  %w[
    mode
    periodic_reporting
    hold_time
    angle_away
    angle_toward
    tscore
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



113
114
115
116
117
118
119
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 113

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



130
131
132
133
134
135
136
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 130

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mode: #{@mode.inspect}, periodic_reporting: #{@periodic_reporting.inspect},"\
  " hold_time: #{@hold_time.inspect}, angle_away: #{@angle_away.inspect}, angle_toward:"\
  " #{@angle_toward.inspect}, tscore: #{@tscore.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
# File 'lib/verizon/models/rbs_high_precision_tilt_config.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mode: #{@mode}, periodic_reporting: #{@periodic_reporting}, hold_time:"\
  " #{@hold_time}, angle_away: #{@angle_away}, angle_toward: #{@angle_toward}, tscore:"\
  " #{@tscore}, additional_properties: #{@additional_properties}>"
end