lib/consul/client/agent.rb in consul-ruby-client-0.0.5 vs lib/consul/client/agent.rb in consul-ruby-client-0.0.6
- old
+ new
@@ -199,12 +199,12 @@
# Returns: Consul::Model::HealthCheck instance
def self.ttl(name, ttl, id = name, notes = nil)
validate_arg name
validate_arg ttl
c = Consul::Model::HealthCheck.new(name: name, ttl: ttl)
- c[:id] = id unless id.nil?
- c[:notes] = notes unless notes.nil?
+ c.id = id unless id.nil?
+ c.notes = notes unless notes.nil?
c
end
# Public: Script Check
#
@@ -218,12 +218,12 @@
def self.script(name, script, interval, id = name, notes = nil)
validate_arg name
validate_arg script
validate_arg interval
c = Consul::Model::HealthCheck.new(name: name, script: script, interval: interval)
- c[:id] = id unless id.nil?
- c[:notes] = notes unless notes.nil?
+ c.id = id unless id.nil?
+ c.notes = notes unless notes.nil?
c
end
# Public: HTTP Check
#
@@ -236,12 +236,12 @@
# Returns: Consul::Model::HealthCheck instance
def self.http(name, http, interval, id = name, notes = nil)
validate_arg name
validate_arg http
validate_arg interval
- c = Consul::Model::HealthCheck.new(name: name, script: script, interval: interval)
- c[:id] = id unless id.nil?
- c[:notes] = notes unless notes.nil?
+ c = Consul::Model::HealthCheck.new(name: name, http: http, interval: interval)
+ c.id = id unless id.nil?
+ c.notes = notes unless notes.nil?
c
end
private