record method get using pattern matching