Class: Consul::Async::SerfMember
- Inherits:
-
Hash
- Object
- Hash
- Consul::Async::SerfMember
- Defined in:
- lib/consul/async/consul_template.rb
Overview
The ServiceInstance has shortcuts (such as service_address method), but is basically a Hash.
Instance Method Summary collapse
-
#initialize(obj) ⇒ SerfMember
constructor
A new instance of SerfMember.
-
#serf_statuses ⇒ Object
List the possible Serf statuses as text, indexed by self.
-
#status ⇒ Object
Return status as text.
Constructor Details
#initialize(obj) ⇒ SerfMember
Returns a new instance of SerfMember.
650 651 652 653 |
# File 'lib/consul/async/consul_template.rb', line 650 def initialize(obj) super merge!(obj) end |
Instance Method Details
#serf_statuses ⇒ Object
List the possible Serf statuses as text, indexed by self
656 657 658 |
# File 'lib/consul/async/consul_template.rb', line 656 def serf_statuses %w[none alive leaving left failed].freeze end |
#status ⇒ Object
Return status as text
661 662 663 |
# File 'lib/consul/async/consul_template.rb', line 661 def status serf_statuses[self['Status']] || "unknownStatus:#{self['Status']}" end |