Method: Azure::Storage::Common::Service::Serialization::ClassMethods#geo_replication_from_xml

Defined in:
lib/azure/storage/common/service/serialization.rb

#geo_replication_from_xml(xml) ⇒ Object


258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/azure/storage/common/service/serialization.rb', line 258

def geo_replication_from_xml(xml)
  xml = slopify(xml)
  expect_node("GeoReplication", xml)

  GeoReplication.new do |geo_replication|
    geo_replication.status = xml.Status.text if (xml > "Status").any?
    geo_replication.last_sync_time =
      begin
        Time.parse(xml.LastSyncTime.text) if (xml > "LastSyncTime").any?
      rescue
        nil
      end
  end
end