Sha256: 798b98ef0616fdc66f23c6b36ca9e5abbbaa6c9e8053d0fd1946c5bd79978e6b

Contents?: true

Size: 378 Bytes

Versions: 2

Compression:

Stored size: 378 Bytes

Contents

class G5Updatable::ClientUpdater
  def initialize(g5_client)
    @g5_client = g5_client
  end

  def update
    attributes = @g5_client.client_hash.dup
    attributes.delete(:locations)
    uid = attributes[:uid]
    urn = attributes[:urn]

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

Version data entries

2 entries across 2 versions & 1 rubygems

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