Sha256: d49d772c857708892d306e344960b918c6e5bc045d81d5c87af35ad6d031954a

Contents?: true

Size: 452 Bytes

Versions: 2

Compression:

Stored size: 452 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)

    G5Updatable::Client.
        find_or_initialize_by(uid: attributes[:uid]).
        update_attributes!(
          urn: attributes[:urn],
          name:  attributes[:name],
          properties: attributes,
          updated_at: DateTime.now
        )
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_updatable-0.10.3 lib/g5_updatable/client_updater.rb
g5_updatable-0.10.2 lib/g5_updatable/client_updater.rb