Class: ConsulSyncer::Endpoint
- Inherits:
-
Object
- Object
- ConsulSyncer::Endpoint
- Defined in:
- lib/consul_syncer/endpoint.rb
Instance Method Summary collapse
-
#initialize(service_hash) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #ip ⇒ Object
- #name ⇒ Object
- #node ⇒ Object
- #port ⇒ Object
- #service_id ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(service_hash) ⇒ Endpoint
Returns a new instance of Endpoint.
4 5 6 |
# File 'lib/consul_syncer/endpoint.rb', line 4 def initialize(service_hash) @hash = service_hash end |
Instance Method Details
#ip ⇒ Object
28 29 30 |
# File 'lib/consul_syncer/endpoint.rb', line 28 def ip @hash.fetch('Node').fetch('Address') end |
#name ⇒ Object
8 9 10 |
# File 'lib/consul_syncer/endpoint.rb', line 8 def name @hash.fetch('Service').fetch('Service') end |
#node ⇒ Object
16 17 18 |
# File 'lib/consul_syncer/endpoint.rb', line 16 def node @hash.fetch('Node').fetch('Node') end |
#port ⇒ Object
20 21 22 |
# File 'lib/consul_syncer/endpoint.rb', line 20 def port @hash.fetch('Service').fetch('Port') end |
#service_id ⇒ Object
12 13 14 |
# File 'lib/consul_syncer/endpoint.rb', line 12 def service_id @hash.fetch('Service').fetch('ID') end |
#tags ⇒ Object
24 25 26 |
# File 'lib/consul_syncer/endpoint.rb', line 24 def @hash.fetch('Service').fetch('Tags', []) end |