class Consul::Async::ConsulTemplateService

Representation as a Map of a Service (includes Service, Node, Checks)

Public Class Methods

new(consul_endpoint) click to toggle source
# File lib/consul/async/consul_template.rb, line 559
def initialize(consul_endpoint)
  super(consul_endpoint)
  @cached_result = []
  @cached_json = nil
end

Public Instance Methods

result_delegate() click to toggle source
# File lib/consul/async/consul_template.rb, line 565
def result_delegate
  return @cached_result if @cached_json == result.json

  new_res = []
  result.json.each do |v|
    new_res << ServiceInstance.new(v)
  end
  @cached_result = new_res
  @cached_json = result.json
  new_res
end