Class: Consul::Async::ConsulTemplateNode
- Inherits:
-
ConsulTemplateAbstractMap
- Object
- ConsulTemplateAbstract
- ConsulTemplateAbstractMap
- Consul::Async::ConsulTemplateNode
- Defined in:
- lib/consul/async/consul_template.rb
Overview
Get information about a single node
Instance Attribute Summary
Attributes inherited from ConsulTemplateAbstract
Instance Method Summary collapse
Methods inherited from ConsulTemplateAbstract
#_seen_at, #initialize, #method_missing, #ready?, #respond_to_missing?
Constructor Details
This class inherits a constructor from Consul::Async::ConsulTemplateAbstract
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Consul::Async::ConsulTemplateAbstract
Instance Method Details
#exists? ⇒ Boolean
619 620 621 |
# File 'lib/consul/async/consul_template.rb', line 619 def exists? !result_delegate.nil? end |
#node ⇒ Object
634 635 636 |
# File 'lib/consul/async/consul_template.rb', line 634 def node safe_get['Node'] || {} end |
#safe_get ⇒ Object
623 624 625 626 627 628 629 630 631 632 |
# File 'lib/consul/async/consul_template.rb', line 623 def safe_get if exists? result_delegate else { 'Node': {}, 'Services': {} } end end |
#services ⇒ Object
638 639 640 |
# File 'lib/consul/async/consul_template.rb', line 638 def services safe_get['Services'] || {} end |