Class: MoesifApi::StatusModel

Inherits:
BaseModel show all
Defined in:
lib/moesif_api/models/status_model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#clean_str, #to_hash, #to_json

Constructor Details

#initialize(status = nil, region = nil) ⇒ StatusModel

Returns a new instance of StatusModel.



23
24
25
26
27
# File 'lib/moesif_api/models/status_model.rb', line 23

def initialize(status = nil,
               region = nil)
  @status = status
  @region = region
end

Instance Attribute Details

#regionString

Location

Returns:



11
12
13
# File 'lib/moesif_api/models/status_model.rb', line 11

def region
  @region
end

#statusBoolean

Status of Call

Returns:

  • (Boolean)


7
8
9
# File 'lib/moesif_api/models/status_model.rb', line 7

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/moesif_api/models/status_model.rb', line 30

def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash
    status = hash["status"]
    region = hash["region"]

    # Create object from extracted values
    StatusModel.new(status,
                          region)
  end
end

.namesObject

A mapping from model property names to API property names



14
15
16
17
18
19
20
21
# File 'lib/moesif_api/models/status_model.rb', line 14

def self.names
  if @hash.nil?
    @hash = {}
    @hash["status"] = "status"
    @hash["region"] = "region"
  end
  @hash
end