Class: Verizon::KPIInfo
- Defined in:
- lib/verizon/models/kpi_info.rb
Overview
KPI Info Object
Instance Attribute Summary collapse
-
#category ⇒ String
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#node_name ⇒ String
TODO: Write general description for this method.
-
#node_type ⇒ String
TODO: Write general description for this method.
-
#time_of_last_update ⇒ String
TODO: Write general description for this method.
-
#unit ⇒ String
TODO: Write general description for this method.
-
#value ⇒ String
TODO: Write general description for this method.
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(name = SKIP, value = SKIP, node_name = SKIP, node_type = SKIP, description = SKIP, unit = SKIP, category = SKIP, time_of_last_update = SKIP) ⇒ KPIInfo
constructor
A new instance of KPIInfo.
Methods inherited from BaseModel
Constructor Details
#initialize(name = SKIP, value = SKIP, node_name = SKIP, node_type = SKIP, description = SKIP, unit = SKIP, category = SKIP, time_of_last_update = SKIP) ⇒ KPIInfo
Returns a new instance of KPIInfo.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/verizon/models/kpi_info.rb', line 77 def initialize(name = SKIP, value = SKIP, node_name = SKIP, node_type = SKIP, description = SKIP, unit = SKIP, category = SKIP, time_of_last_update = SKIP) @name = name unless name == SKIP @value = value unless value == SKIP @node_name = node_name unless node_name == SKIP @node_type = node_type unless node_type == SKIP @description = description unless description == SKIP @unit = unit unless unit == SKIP @category = category unless category == SKIP @time_of_last_update = time_of_last_update unless time_of_last_update == SKIP end |
Instance Attribute Details
#category ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/verizon/models/kpi_info.rb', line 38 def category @category end |
#description ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/kpi_info.rb', line 30 def description @description end |
#name ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/kpi_info.rb', line 14 def name @name end |
#node_name ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/kpi_info.rb', line 22 def node_name @node_name end |
#node_type ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/kpi_info.rb', line 26 def node_type @node_type end |
#time_of_last_update ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/verizon/models/kpi_info.rb', line 42 def time_of_last_update @time_of_last_update end |
#unit ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/kpi_info.rb', line 34 def unit @unit end |
#value ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/kpi_info.rb', line 18 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/verizon/models/kpi_info.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP node_name = hash.key?('nodeName') ? hash['nodeName'] : SKIP node_type = hash.key?('nodeType') ? hash['nodeType'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP unit = hash.key?('unit') ? hash['unit'] : SKIP category = hash.key?('category') ? hash['category'] : SKIP time_of_last_update = hash.key?('timeOfLastUpdate') ? hash['timeOfLastUpdate'] : SKIP # Create object from extracted values. KPIInfo.new(name, value, node_name, node_type, description, unit, category, time_of_last_update) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/kpi_info.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['value'] = 'value' @_hash['node_name'] = 'nodeName' @_hash['node_type'] = 'nodeType' @_hash['description'] = 'description' @_hash['unit'] = 'unit' @_hash['category'] = 'category' @_hash['time_of_last_update'] = 'timeOfLastUpdate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/verizon/models/kpi_info.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/verizon/models/kpi_info.rb', line 59 def self.optionals %w[ name value node_name node_type description unit category time_of_last_update ] end |