Class: A4Tools::KaiConfigClient
Instance Attribute Summary collapse
#timeout
Attributes inherited from AcresClient
#connect_time, #connected, #history, #password, #ready, #server_info, #start_time, #token, #uri, #username, #version
Instance Method Summary
collapse
#[], cache, #cache, #dirty, #ensure_fresh, #fresh?, #initialize, #query, query, #refresh, #refresh_async, #send_update_request, #timestamp_expired?, #update_from_method
Methods inherited from AcresClient
#add_message_to_history, #app_info, #attempt_snoop, #authenticate, #authenticate_if_needed, #connect, #connect_if_needed, #device_info, #disconnect, #empty_query, #initialize, #inject_token, #jsonrpc_message, #make_password, #next_msg_id, #response_body, #send_message, #snoop_token, #transport_connect, #wrapped_message
#on, #passthrough, #signal
Instance Attribute Details
#cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
3
4
5
|
# File 'lib/clients/kai_config_client.rb', line 3
def cache_timeout
@cache_timeout
end
|
Instance Method Details
#banks ⇒ Object
35
36
37
|
# File 'lib/clients/kai_config_client.rb', line 35
def banks
(section_bank_info[:banks].map { |bank| bank[:bankName] })
end
|
#machines ⇒ Object
27
28
29
|
# File 'lib/clients/kai_config_client.rb', line 27
def machines
(section_bank_info[:locations].map { |loc| loc[:location] })
end
|
#section_bank_info ⇒ Object
23
24
25
|
# File 'lib/clients/kai_config_client.rb', line 23
def section_bank_info
strip_wrapper(query(:configValueRequest, talk["SECTION_BANK_LOCATION_VALUES"]))
end
|
#sections ⇒ Object
31
32
33
|
# File 'lib/clients/kai_config_client.rb', line 31
def sections
(section_bank_info[:sections].map { |sect| sect[:sectionName] })
end
|
#site_version ⇒ Object
19
20
21
|
# File 'lib/clients/kai_config_client.rb', line 19
def site_version
response_body(send_message(empty_query(:getConfigWebVersion)))[:stringValue] rescue nil
end
|
#strip_wrapper(result) ⇒ Object
13
14
15
16
17
|
# File 'lib/clients/kai_config_client.rb', line 13
def strip_wrapper(result)
body = result[:configValueWrappers][0][:wrappedConfigValues][0][:body]
body[:__class] = result[:configValueWrappers][0][:wrappedConfigValues][0][:className]
body
end
|