module Unleash class Context attr_accessor :user_id, :session_id, :remote_address, :properties def initialize(params = {}) params_is_a_hash = params.is_a?(Hash) self.user_id = params_is_a_hash ? params.fetch(:user_id, '') : '' self.session_id = params_is_a_hash ? params.fetch(:session_id, '') : '' self.remote_address = params_is_a_hash ? params.fetch(:remote_address, '') : '' self.properties = params_is_a_hash && params[:properties].is_a?(Hash) ? params.fetch(:properties, {}) : {} end def to_s "" end end end