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.
672 673 674 |
# File 'lib/consul/async/consul_template.rb', line 672 def initialize(obj) merge!(obj) end |
Instance Method Details
#serf_statuses ⇒ Object
List the possible Serf statuses as text, indexed by self
677 678 679 |
# File 'lib/consul/async/consul_template.rb', line 677 def serf_statuses %w[none alive leaving left failed].freeze end |
#status ⇒ Object
Return status as text
682 683 684 |
# File 'lib/consul/async/consul_template.rb', line 682 def status serf_statuses[self['Status']] || "unknownStatus:#{self['Status']}" end |