Class: SuggestGrid::DeleteSuccessResponse
- Defined in:
- lib/suggest_grid/models/delete_success_response.rb
Instance Attribute Summary collapse
-
#deleted ⇒ Long
The number of records deleted.
-
#failed ⇒ Long
The number of records failed to be deleted.
-
#found ⇒ Long
The number of records found.
-
#message ⇒ String
Message of the response.
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(message = nil, found = nil, deleted = nil, failed = nil, additional_properties = {}) ⇒ DeleteSuccessResponse
constructor
A new instance of DeleteSuccessResponse.
Methods inherited from BaseModel
#method_missing, #respond_to?, #to_hash, #to_json
Constructor Details
#initialize(message = nil, found = nil, deleted = nil, failed = nil, additional_properties = {}) ⇒ DeleteSuccessResponse
Returns a new instance of DeleteSuccessResponse.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 33 def initialize( = nil, found = nil, deleted = nil, failed = nil, additional_properties = {}) = @found = found @deleted = deleted @failed = failed # Add additional model properties to the instance additional_properties.each {|name, value| instance_variable_set("@#{name}", value)} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SuggestGrid::BaseModel
Instance Attribute Details
#deleted ⇒ Long
The number of records deleted.
15 16 17 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 15 def deleted @deleted end |
#failed ⇒ Long
The number of records failed to be deleted.
19 20 21 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 19 def failed @failed end |
#found ⇒ Long
The number of records found.
11 12 13 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 11 def found @found end |
#message ⇒ String
Message of the response.
7 8 9 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 7 def end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 48 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash = hash["message"] found = hash["found"] deleted = hash["deleted"] failed = hash["failed"] # Clean out expected properties from Hash names.values.each {|k| hash.delete(k)} # Create object from extracted values DeleteSuccessResponse.new(, found, deleted, failed, hash) end end |
.names ⇒ Object
A mapping from model property names to API property names
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/suggest_grid/models/delete_success_response.rb', line 22 def self.names if @hash.nil? @hash = {} @hash["message"] = "message" @hash["found"] = "found" @hash["deleted"] = "deleted" @hash["failed"] = "failed" end @hash end |