Class: MistApi::MapNode
- Defined in:
- lib/mist_api/models/map_node.rb
Overview
Nodes on maps
Instance Attribute Summary collapse
-
#edges ⇒ Hash[String, String]
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#position ⇒ MapNodePosition
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 = nil, edges = SKIP, position = SKIP) ⇒ MapNode
constructor
A new instance of MapNode.
-
#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(name = nil, edges = SKIP, position = SKIP) ⇒ MapNode
Returns a new instance of MapNode.
46 47 48 49 50 |
# File 'lib/mist_api/models/map_node.rb', line 46 def initialize(name = nil, edges = SKIP, position = SKIP) @edges = edges unless edges == SKIP @name = name @position = position unless position == SKIP end |
Instance Attribute Details
#edges ⇒ Hash[String, String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/map_node.rb', line 14 def edges @edges end |
#name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/map_node.rb', line 18 def name @name end |
#position ⇒ MapNodePosition
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/map_node.rb', line 22 def position @position end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/mist_api/models/map_node.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil edges = hash.key?('edges') ? hash['edges'] : SKIP position = MapNodePosition.from_hash(hash['position']) if hash['position'] # Create object from extracted values. MapNode.new(name, edges, position) 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/map_node.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['edges'] = 'edges' @_hash['name'] = 'name' @_hash['position'] = 'position' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/mist_api/models/map_node.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/mist_api/models/map_node.rb', line 34 def self.optionals %w[ edges position ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
74 75 76 77 78 |
# File 'lib/mist_api/models/map_node.rb', line 74 def inspect class_name = self.class.name.split('::').last "<#{class_name} edges: #{@edges.inspect}, name: #{@name.inspect}, position:"\ " #{@position.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
68 69 70 71 |
# File 'lib/mist_api/models/map_node.rb', line 68 def to_s class_name = self.class.name.split('::').last "<#{class_name} edges: #{@edges}, name: #{@name}, position: #{@position}>" end |