add bar attribute validations and rspec tests