Class: MistApi::OspfArea
- Defined in:
- lib/mist_api/models/ospf_area.rb
Overview
Property key is the OSPF Area (Area should be a number (0-255) / IP address)
Instance Attribute Summary collapse
-
#include_loopback ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#networks ⇒ Hash[String, OspfAreasNetwork]
TODO: Write general description for this method.
-
#type ⇒ OspfAreaTypeEnum
OSPF type.
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(include_loopback = false, networks = SKIP, type = OspfAreaTypeEnum::DEFAULT) ⇒ OspfArea
constructor
A new instance of OspfArea.
-
#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(include_loopback = false, networks = SKIP, type = OspfAreaTypeEnum::DEFAULT) ⇒ OspfArea
Returns a new instance of OspfArea.
47 48 49 50 51 52 |
# File 'lib/mist_api/models/ospf_area.rb', line 47 def initialize(include_loopback = false, networks = SKIP, type = OspfAreaTypeEnum::DEFAULT) @include_loopback = include_loopback unless include_loopback == SKIP @networks = networks unless networks == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#include_loopback ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/ospf_area.rb', line 14 def include_loopback @include_loopback end |
#networks ⇒ Hash[String, OspfAreasNetwork]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/ospf_area.rb', line 18 def networks @networks end |
#type ⇒ OspfAreaTypeEnum
OSPF type. enum: ‘default`, `nssa`, `stub`
22 23 24 |
# File 'lib/mist_api/models/ospf_area.rb', line 22 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/ospf_area.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. include_loopback = hash['include_loopback'] ||= false networks = OspfAreasNetwork.from_hash(hash['networks']) if hash['networks'] networks = SKIP unless hash.key?('networks') type = hash['type'] ||= OspfAreaTypeEnum::DEFAULT # Create object from extracted values. OspfArea.new(include_loopback, networks, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/mist_api/models/ospf_area.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['include_loopback'] = 'include_loopback' @_hash['networks'] = 'networks' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/mist_api/models/ospf_area.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/mist_api/models/ospf_area.rb', line 34 def self.optionals %w[ include_loopback networks type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
79 80 81 82 83 |
# File 'lib/mist_api/models/ospf_area.rb', line 79 def inspect class_name = self.class.name.split('::').last "<#{class_name} include_loopback: #{@include_loopback.inspect}, networks:"\ " #{@networks.inspect}, type: #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
72 73 74 75 76 |
# File 'lib/mist_api/models/ospf_area.rb', line 72 def to_s class_name = self.class.name.split('::').last "<#{class_name} include_loopback: #{@include_loopback}, networks: #{@networks}, type:"\ " #{@type}>" end |