code: func NewMobileDetect(r *http.Request, rules *rules) *MobileDetect {
  	if nil == rules {
  		rules = NewRules()
  	}
  	md := &MobileDetect{
  		rules:              rules,
  		userAgent:          r.UserAgent(),
  		httpHeaders:        getHttpHeaders(r),
  		compiledRegexRules: make(map[string]*regexp.Regexp, len(rules.mobileDetectionRules())),
  		properties:         newProperties(),
  	}
  	return md
  }
docs: // NewMobileDetect creates the MobileDetect object