class MdNotes::ServiceStatus

ServiceStatus Model.

Attributes

app[RW]

TODO: Write general description for this method @return [String]

moto[RW]

TODO: Write general description for this method @return [String]

notes[RW]

TODO: Write general description for this method @return [Integer]

os[RW]

TODO: Write general description for this method @return [String]

php_version[RW]

TODO: Write general description for this method @return [String]

status[RW]

TODO: Write general description for this method @return [String]

time[RW]

TODO: Write general description for this method @return [String]

users[RW]

TODO: Write general description for this method @return [Integer]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# 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
names() click to toggle source

A mapping from model property names to API property names.

# 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
new(app = nil, moto = nil, notes = nil, users = nil, time = nil, os = nil, php_version = nil, status = nil, additional_properties = {}) click to toggle source
# 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