lib/ldclient-rb/ldclient.rb
#
# Returns all feature flag values for the given user
#
Returns all feature flag values for the given user
Returns all feature flag values for the given user
def all_flags(user)
      sanitize_user(user)
      return Hash.new if @config.offline?
      unless user
        @config.logger.error("[LDClient] Must specify user in all_flags")
        return Hash.new
      end
      begin
        features = @store.all
        Hash[features.map{ |k, f| [k, evaluate(f, user, @store)[:value]] }]
      rescue => exn
        @config.logger.warn("[LDClient] Error evaluating all flags: #{exn.inspect}. \nTrace: #{exn.backtrace}")
        return Hash.new
      end
    end
def all_flags ( user ) sanitize_user ( user ) return Hash . new if @config . offline? unless user @config . logger . error ( "[LDClient] Must specify user in all_flags" ) return Hash . new end begin features = @store . all Hash [ features . map { | k , f | [ k , evaluate ( f , user , @store ) [ :value ] ] } ] rescue => exn @config . logger . warn ( "[LDClient] Error evaluating all flags: #{exn.inspect}. \nTrace: #{exn.backtrace}" ) return Hash . new end end
Returns all feature flag values for the given user
Returns all feature flag values for the given user
# TODO rescue if necessary
user