Class: Consul::Async::ConsulTemplateAbstract
- Inherits:
-
Object
- Object
- Consul::Async::ConsulTemplateAbstract
- Defined in:
- lib/consul/async/consul_template.rb
Overview
Abstract class that stores information about a result
Direct Known Subclasses
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#seen_at ⇒ Object
readonly
Returns the value of attribute seen_at.
Instance Method Summary collapse
- #_seen_at(val) ⇒ Object
-
#initialize(consul_endpoint) ⇒ ConsulTemplateAbstract
constructor
A new instance of ConsulTemplateAbstract.
- #method_missing(method_name, *args, &block) ⇒ Object
- #ready? ⇒ Boolean
- #respond_to_missing?(method_name, *args) ⇒ Boolean
Constructor Details
#initialize(consul_endpoint) ⇒ ConsulTemplateAbstract
Returns a new instance of ConsulTemplateAbstract.
446 447 448 449 450 451 452 |
# File 'lib/consul/async/consul_template.rb', line 446 def initialize(consul_endpoint) @endpoint = consul_endpoint consul_endpoint.on_response do |res| @result = parse_result(res) end @result = parse_result(consul_endpoint.last_result) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
462 463 464 465 466 467 468 |
# File 'lib/consul/async/consul_template.rb', line 462 def method_missing(method_name, *args, &block) if result_delegate.respond_to?(method_name) result_delegate.send(method_name, *args, &block) else super end end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
444 445 446 |
# File 'lib/consul/async/consul_template.rb', line 444 def endpoint @endpoint end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
444 445 446 |
# File 'lib/consul/async/consul_template.rb', line 444 def result @result end |
#seen_at ⇒ Object (readonly)
Returns the value of attribute seen_at.
444 445 446 |
# File 'lib/consul/async/consul_template.rb', line 444 def seen_at @seen_at end |
Instance Method Details
#_seen_at(val) ⇒ Object
454 455 456 |
# File 'lib/consul/async/consul_template.rb', line 454 def _seen_at(val) @seen_at = val end |
#ready? ⇒ Boolean
458 459 460 |
# File 'lib/consul/async/consul_template.rb', line 458 def ready? @endpoint.ready? end |
#respond_to_missing?(method_name, *args) ⇒ Boolean
470 471 472 |
# File 'lib/consul/async/consul_template.rb', line 470 def respond_to_missing?(method_name, *args) result_delegate.respond_to?(method_name, *args) end |