Class: MistApi::IpStat
- Defined in:
- lib/mist_api/models/ip_stat.rb
Overview
IpStat Model.
Instance Attribute Summary collapse
-
#dhcp_server ⇒ String
TODO: Write general description for this method.
-
#dns ⇒ Array[String]
TODO: Write general description for this method.
-
#dns_suffix ⇒ Array[String]
TODO: Write general description for this method.
-
#gateway ⇒ String
TODO: Write general description for this method.
-
#gateway6 ⇒ String
TODO: Write general description for this method.
-
#ip ⇒ String
TODO: Write general description for this method.
-
#ip6 ⇒ String
TODO: Write general description for this method.
-
#ips ⇒ Hash[String, String]
TODO: Write general description for this method.
-
#netmask ⇒ String
TODO: Write general description for this method.
-
#netmask6 ⇒ 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(dhcp_server = SKIP, dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, ips = SKIP, netmask = SKIP, netmask6 = SKIP) ⇒ IpStat
constructor
A new instance of IpStat.
-
#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(dhcp_server = SKIP, dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, ips = SKIP, netmask = SKIP, netmask6 = SKIP) ⇒ IpStat
Returns a new instance of IpStat.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mist_api/models/ip_stat.rb', line 97 def initialize(dhcp_server = SKIP, dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, ips = SKIP, netmask = SKIP, netmask6 = SKIP) @dhcp_server = dhcp_server unless dhcp_server == SKIP @dns = dns unless dns == SKIP @dns_suffix = dns_suffix unless dns_suffix == SKIP @gateway = gateway unless gateway == SKIP @gateway6 = gateway6 unless gateway6 == SKIP @ip = ip unless ip == SKIP @ip6 = ip6 unless ip6 == SKIP @ips = ips unless ips == SKIP @netmask = netmask unless netmask == SKIP @netmask6 = netmask6 unless netmask6 == SKIP end |
Instance Attribute Details
#dhcp_server ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/ip_stat.rb', line 14 def dhcp_server @dhcp_server end |
#dns ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/ip_stat.rb', line 18 def dns @dns end |
#dns_suffix ⇒ Array[String]
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/ip_stat.rb', line 22 def dns_suffix @dns_suffix end |
#gateway ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/ip_stat.rb', line 26 def gateway @gateway end |
#gateway6 ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/ip_stat.rb', line 30 def gateway6 @gateway6 end |
#ip ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/ip_stat.rb', line 34 def ip @ip end |
#ip6 ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/ip_stat.rb', line 38 def ip6 @ip6 end |
#ips ⇒ Hash[String, String]
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/ip_stat.rb', line 42 def ips @ips end |
#netmask ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/mist_api/models/ip_stat.rb', line 46 def netmask @netmask end |
#netmask6 ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/mist_api/models/ip_stat.rb', line 50 def netmask6 @netmask6 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/ip_stat.rb', line 113 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dhcp_server = hash.key?('dhcp_server') ? hash['dhcp_server'] : SKIP dns = hash.key?('dns') ? hash['dns'] : SKIP dns_suffix = hash.key?('dns_suffix') ? hash['dns_suffix'] : SKIP gateway = hash.key?('gateway') ? hash['gateway'] : SKIP gateway6 = hash.key?('gateway6') ? hash['gateway6'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP ip6 = hash.key?('ip6') ? hash['ip6'] : SKIP ips = hash.key?('ips') ? hash['ips'] : SKIP netmask = hash.key?('netmask') ? hash['netmask'] : SKIP netmask6 = hash.key?('netmask6') ? hash['netmask6'] : SKIP # Create object from extracted values. IpStat.new(dhcp_server, dns, dns_suffix, gateway, gateway6, ip, ip6, ips, netmask, netmask6) 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/mist_api/models/ip_stat.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['dhcp_server'] = 'dhcp_server' @_hash['dns'] = 'dns' @_hash['dns_suffix'] = 'dns_suffix' @_hash['gateway'] = 'gateway' @_hash['gateway6'] = 'gateway6' @_hash['ip'] = 'ip' @_hash['ip6'] = 'ip6' @_hash['ips'] = 'ips' @_hash['netmask'] = 'netmask' @_hash['netmask6'] = 'netmask6' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/mist_api/models/ip_stat.rb', line 85 def self.nullables %w[ dhcp_server gateway gateway6 ip ip6 netmask netmask6 ] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mist_api/models/ip_stat.rb', line 69 def self.optionals %w[ dhcp_server dns dns_suffix gateway gateway6 ip ip6 ips netmask netmask6 ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
150 151 152 153 154 155 156 |
# File 'lib/mist_api/models/ip_stat.rb', line 150 def inspect class_name = self.class.name.split('::').last "<#{class_name} dhcp_server: #{@dhcp_server.inspect}, dns: #{@dns.inspect}, dns_suffix:"\ " #{@dns_suffix.inspect}, gateway: #{@gateway.inspect}, gateway6: #{@gateway6.inspect}, ip:"\ " #{@ip.inspect}, ip6: #{@ip6.inspect}, ips: #{@ips.inspect}, netmask: #{@netmask.inspect},"\ " netmask6: #{@netmask6.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
142 143 144 145 146 147 |
# File 'lib/mist_api/models/ip_stat.rb', line 142 def to_s class_name = self.class.name.split('::').last "<#{class_name} dhcp_server: #{@dhcp_server}, dns: #{@dns}, dns_suffix: #{@dns_suffix},"\ " gateway: #{@gateway}, gateway6: #{@gateway6}, ip: #{@ip}, ip6: #{@ip6}, ips: #{@ips},"\ " netmask: #{@netmask}, netmask6: #{@netmask6}>" end |