Sha256: 55bb55ee22a6a20420b8ae656938a9d7c9c1daf96dc2bd16a9214e5bdd071396

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

class G5Updatable::LocationsUpdater
  def initialize(g5_locations)
    @g5_locations = g5_locations
  end

  def update
    @g5_locations.each do |g5_location|
      attributes = g5_location.location_hash.dup
      uid        = attributes[:uid]
      urn        = attributes[:urn]
      client_uid = attributes[:client_uid]

      G5Updatable::Location.
          find_or_initialize_by(uid: uid).
          update_attributes!(
          urn:        urn,
          client_uid: client_uid,
          properties: attributes
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_updatable-0.3.2 lib/g5_updatable/locations_updater.rb
g5_updatable-0.3.1 lib/g5_updatable/locations_updater.rb