class GetStatusResponse

Class GetStatusResponse represents server response on get_status Status API request. Server response is sent to from_array method which creates objects attributes exists, externalID, source, history accessible via getters:

Example:

response = GetStatusResponse.from_array(...)    # => Array

Public Class Methods

from_array(json) click to toggle source

Method from_array creates GetStatusResponse object

# File lib/dto/status/get_status_response.rb, line 33
def self.from_array(json)
   json.each do |hash|
    hash.each do |key, value|
      self.new("#{key}=".to_sym, key == 'history' ?  value.collect {
        |key, items| Status.new(:field => key, :attrs => items.collect {|item| 
         Attr.new(:timestamp => item["timestamp"], :errors => item["errors"], :attributes => item["attributes"]) }
        )} : value )
    end
  end
end