Class: Consul::Async::ConsulTemplateMembers

Inherits:
ConsulTemplateAbstractArray show all
Defined in:
lib/consul/async/consul_template.rb

Overview

List of serf members of the whole cluster

Instance Attribute Summary

Attributes inherited from ConsulTemplateAbstract

#endpoint, #result, #seen_at

Instance Method Summary collapse

Methods inherited from ConsulTemplateAbstract

#_seen_at, #method_missing, #ready?, #respond_to_missing?

Constructor Details

#initialize(consul_endpoint) ⇒ ConsulTemplateMembers

Returns a new instance of ConsulTemplateMembers.



689
690
691
# File 'lib/consul/async/consul_template.rb', line 689

def initialize(consul_endpoint)
  super(consul_endpoint)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Consul::Async::ConsulTemplateAbstract

Instance Method Details

#result_delegateObject



693
694
695
696
697
698
699
700
701
702
703
# File 'lib/consul/async/consul_template.rb', line 693

def result_delegate
  return @cached_result if @cached_json == result.json

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