Class: G5Updatable::ClientFeedProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/g5_updatable/client_feed_processor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_uid = nil) ⇒ ClientFeedProcessor

Returns a new instance of ClientFeedProcessor.



4
5
6
7
# File 'lib/g5_updatable/client_feed_processor.rb', line 4

def initialize(client_uid=nil)
  @client_uid = client_uid || ENV["CLIENT_UID"]
  raise "A client_uid must be either passed in or configured!" if @client_uid.blank?
end

Instance Attribute Details

#client_uidObject (readonly)

Returns the value of attribute client_uid.



2
3
4
# File 'lib/g5_updatable/client_feed_processor.rb', line 2

def client_uid
  @client_uid
end

Class Method Details

.load_all_clients(clients_url) ⇒ Object



10
11
12
13
# File 'lib/g5_updatable/client_feed_processor.rb', line 10

def load_all_clients(clients_url)
  client_uids = G5FoundationClient::Client.all_client_uids clients_url
  client_uids.collect { |client_uid| new(client_uid).work }
end

Instance Method Details

#workObject



16
17
18
19
20
21
# File 'lib/g5_updatable/client_feed_processor.rb', line 16

def work
  client = update_client
  update_locations

  client
end