Class: CtdDocumentation::ActionableRelatedAsset
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CtdDocumentation::ActionableRelatedAsset
- Defined in:
- lib/ctd_documentation/models/actionable_related_asset.rb
Overview
ActionableRelatedAsset Model.
Instance Attribute Summary collapse
-
#asset_type_name ⇒ String
TODO: Write general description for this method.
-
#asset_type_number ⇒ Integer
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#ip ⇒ List of String
TODO: Write general description for this method.
-
#mac ⇒ List of String
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#network_id ⇒ Integer
TODO: Write general description for this method.
-
#resource_id ⇒ String
TODO: Write general description for this method.
-
#site_id ⇒ Integer
TODO: Write general description for this method.
-
#vendor ⇒ 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(site_id = SKIP, resource_id = SKIP, id = SKIP, ip = SKIP, mac = SKIP, asset_type_number = SKIP, asset_type_name = SKIP, name = SKIP, network_id = SKIP, vendor = SKIP) ⇒ ActionableRelatedAsset
constructor
A new instance of ActionableRelatedAsset.
Methods inherited from BaseModel
Constructor Details
#initialize(site_id = SKIP, resource_id = SKIP, id = SKIP, ip = SKIP, mac = SKIP, asset_type_number = SKIP, asset_type_name = SKIP, name = SKIP, network_id = SKIP, vendor = SKIP) ⇒ ActionableRelatedAsset
Returns a new instance of ActionableRelatedAsset.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 89 def initialize(site_id = SKIP, resource_id = SKIP, id = SKIP, ip = SKIP, mac = SKIP, asset_type_number = SKIP, asset_type_name = SKIP, name = SKIP, network_id = SKIP, vendor = SKIP) @site_id = site_id unless site_id == SKIP @resource_id = resource_id unless resource_id == SKIP @id = id unless id == SKIP @ip = ip unless ip == SKIP @mac = mac unless mac == SKIP @asset_type_number = asset_type_number unless asset_type_number == SKIP @asset_type_name = asset_type_name unless asset_type_name == SKIP @name = name unless name == SKIP @network_id = network_id unless network_id == SKIP @vendor = vendor unless vendor == SKIP end |
Instance Attribute Details
#asset_type_name ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 38 def asset_type_name @asset_type_name end |
#asset_type_number ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 34 def asset_type_number @asset_type_number end |
#id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 22 def id @id end |
#ip ⇒ List of String
TODO: Write general description for this method
26 27 28 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 26 def ip @ip end |
#mac ⇒ List of String
TODO: Write general description for this method
30 31 32 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 30 def mac @mac end |
#name ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 42 def name @name end |
#network_id ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 46 def network_id @network_id end |
#resource_id ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 18 def resource_id @resource_id end |
#site_id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 14 def site_id @site_id end |
#vendor ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 50 def vendor @vendor end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 112 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. site_id = hash.key?('site_id') ? hash['site_id'] : SKIP resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP asset_type_number = hash.key?('asset_type_number') ? hash['asset_type_number'] : SKIP asset_type_name = hash.key?('asset_type_name') ? hash['asset_type_name'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP network_id = hash.key?('network_id') ? hash['network_id'] : SKIP vendor = hash.key?('vendor') ? hash['vendor'] : SKIP # Create object from extracted values. .new(site_id, resource_id, id, ip, mac, asset_type_number, asset_type_name, name, network_id, vendor) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['site_id'] = 'site_id' @_hash['resource_id'] = 'resource_id' @_hash['id'] = 'id' @_hash['ip'] = 'ip' @_hash['mac'] = 'mac' @_hash['asset_type_number'] = 'asset_type_number' @_hash['asset_type_name'] = 'asset_type_name' @_hash['name'] = 'name' @_hash['network_id'] = 'network_id' @_hash['vendor'] = 'vendor' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/ctd_documentation/models/actionable_related_asset.rb', line 69 def self.optionals %w[ site_id resource_id id ip mac asset_type_number asset_type_name name network_id vendor ] end |