Class: MistApi::SsrVersion

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/ssr_version.rb

Overview

SsrVersion Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(package = nil, version = nil, default = SKIP, tags = SKIP) ⇒ SsrVersion

Returns a new instance of SsrVersion.



51
52
53
54
55
56
# File 'lib/mist_api/models/ssr_version.rb', line 51

def initialize(package = nil, version = nil, default = SKIP, tags = SKIP)
  @default = default unless default == SKIP
  @package = package
  @tags = tags unless tags == SKIP
  @version = version
end

Instance Attribute Details

#defaultTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/mist_api/models/ssr_version.rb', line 14

def default
  @default
end

#packageString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/ssr_version.rb', line 18

def package
  @package
end

#tagsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


22
23
24
# File 'lib/mist_api/models/ssr_version.rb', line 22

def tags
  @tags
end

#versionString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/ssr_version.rb', line 26

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/ssr_version.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  package = hash.key?('package') ? hash['package'] : nil
  version = hash.key?('version') ? hash['version'] : nil
  default = hash.key?('default') ? hash['default'] : SKIP
  tags = hash.key?('tags') ? hash['tags'] : SKIP

  # Create object from extracted values.
  SsrVersion.new(package,
                 version,
                 default,
                 tags)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/ssr_version.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['default'] = 'default'
  @_hash['package'] = 'package'
  @_hash['tags'] = 'tags'
  @_hash['version'] = 'version'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/mist_api/models/ssr_version.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
# File 'lib/mist_api/models/ssr_version.rb', line 39

def self.optionals
  %w[
    default
    tags
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



83
84
85
86
87
# File 'lib/mist_api/models/ssr_version.rb', line 83

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} default: #{@default.inspect}, package: #{@package.inspect}, tags:"\
  " #{@tags.inspect}, version: #{@version.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



76
77
78
79
80
# File 'lib/mist_api/models/ssr_version.rb', line 76

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} default: #{@default}, package: #{@package}, tags: #{@tags}, version:"\
  " #{@version}>"
end