lib/unleash/strategy/application_hostname.rb in unleash-0.1.6 vs lib/unleash/strategy/application_hostname.rb in unleash-3.2.0

- old
+ new

@@ -2,11 +2,11 @@ module Unleash module Strategy class ApplicationHostname < Base attr_accessor :hostname - PARAM = 'hostnames' + PARAM = 'hostnames'.freeze def initialize self.hostname = Socket.gethostname || 'undefined' end @@ -16,10 +16,10 @@ # need: :params['hostnames'] def is_enabled?(params = {}, _context = nil) return false unless params.is_a?(Hash) && params.has_key?(PARAM) - params[PARAM].split(",").map(&:strip).map{ |h| h.downcase }.include?(self.hostname) + params[PARAM].split(",").map(&:strip).map(&:downcase).include?(self.hostname) end end end end