def sample for Ruby