Class: MoesifApi::StatusModel
- Defined in:
- lib/moesif_api/models/status_model.rb
Instance Attribute Summary collapse
-
#region ⇒ String
Location.
-
#status ⇒ Boolean
Status of Call.
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(status = nil, region = nil) ⇒ StatusModel
constructor
A new instance of StatusModel.
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
#region ⇒ String
Location
11 12 13 |
# File 'lib/moesif_api/models/status_model.rb', line 11 def region @region end |
#status ⇒ Boolean
Status of Call
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 |
.names ⇒ Object
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 |