Class: MdNotes::ServiceStatus

Inherits:
BaseModel show all
Defined in:
lib/md_notes/models/service_status.rb

Overview

ServiceStatus Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#method_missing, #respond_to_missing?, #to_hash, #to_json

Constructor Details

#initialize(app = nil, moto = nil, notes = nil, users = nil, time = nil, os = nil, php_version = nil, status = nil, additional_properties = {}) ⇒ ServiceStatus

Returns a new instance of ServiceStatus.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/md_notes/models/service_status.rb', line 55

def initialize(app = nil,
               moto = nil,
               notes = nil,
               users = nil,
               time = nil,
               os = nil,
               php_version = nil,
               status = nil,
               additional_properties = {})
  @app = app
  @moto = moto
  @notes = notes
  @users = users
  @time = time
  @os = os
  @php_version = php_version
  @status = status

  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MdNotes::BaseModel

Instance Attribute Details

#appString

TODO: Write general description for this method

Returns:

  • (String)


11
12
13
# File 'lib/md_notes/models/service_status.rb', line 11

def app
  @app
end

#motoString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/md_notes/models/service_status.rb', line 15

def moto
  @moto
end

#notesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


19
20
21
# File 'lib/md_notes/models/service_status.rb', line 19

def notes
  @notes
end

#osString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/md_notes/models/service_status.rb', line 31

def os
  @os
end

#php_versionString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/md_notes/models/service_status.rb', line 35

def php_version
  @php_version
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/md_notes/models/service_status.rb', line 39

def status
  @status
end

#timeString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/md_notes/models/service_status.rb', line 27

def time
  @time
end

#usersInteger

TODO: Write general description for this method

Returns:

  • (Integer)


23
24
25
# File 'lib/md_notes/models/service_status.rb', line 23

def users
  @users
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/md_notes/models/service_status.rb', line 80

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  app = hash['app']
  moto = hash['moto']
  notes = hash['notes']
  users = hash['users']
  time = hash['time']
  os = hash['os']
  php_version = hash['php_version']
  status = hash['status']

  # Clean out expected properties from Hash.
  names.each_value { |k| hash.delete(k) }

  # Create object from extracted values.
  ServiceStatus.new(app,
                    moto,
                    notes,
                    users,
                    time,
                    os,
                    php_version,
                    status,
                    hash)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/md_notes/models/service_status.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['app'] = 'app'
  @_hash['moto'] = 'moto'
  @_hash['notes'] = 'notes'
  @_hash['users'] = 'users'
  @_hash['time'] = 'time'
  @_hash['os'] = 'os'
  @_hash['php_version'] = 'php_version'
  @_hash['status'] = 'status'
  @_hash
end