Class: MdNotes::ServiceStatus
- Defined in:
- lib/md_notes/models/service_status.rb
Overview
ServiceStatus Model.
Instance Attribute Summary collapse
-
#app ⇒ String
TODO: Write general description for this method.
-
#moto ⇒ String
TODO: Write general description for this method.
-
#notes ⇒ Integer
TODO: Write general description for this method.
-
#os ⇒ String
TODO: Write general description for this method.
-
#php_version ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
-
#time ⇒ String
TODO: Write general description for this method.
-
#users ⇒ Integer
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.
Instance Method Summary collapse
-
#initialize(app = nil, moto = nil, notes = nil, users = nil, time = nil, os = nil, php_version = nil, status = nil, additional_properties = {}) ⇒ ServiceStatus
constructor
A new instance of ServiceStatus.
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
#app ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/md_notes/models/service_status.rb', line 11 def app @app end |
#moto ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/md_notes/models/service_status.rb', line 15 def moto @moto end |
#notes ⇒ Integer
TODO: Write general description for this method
19 20 21 |
# File 'lib/md_notes/models/service_status.rb', line 19 def notes @notes end |
#os ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/md_notes/models/service_status.rb', line 31 def os @os end |
#php_version ⇒ String
TODO: Write general description for this method
35 36 37 |
# File 'lib/md_notes/models/service_status.rb', line 35 def php_version @php_version end |
#status ⇒ String
TODO: Write general description for this method
39 40 41 |
# File 'lib/md_notes/models/service_status.rb', line 39 def status @status end |
#time ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/md_notes/models/service_status.rb', line 27 def time @time end |
#users ⇒ Integer
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |