Sha256: 53322479a83d27b48abb1c97b6991f613502a74d9db5473d2bdf7f182bfdb167

Contents?: true

Size: 299 Bytes

Versions: 4

Compression:

Stored size: 299 Bytes

Contents

module Codebreaker
  class Player
    include Mixins::Validator

    NAME_SIZE = {
      min: 3,
      max: 20
    }.freeze

    attr_reader :name

    def initialize(name)
      @name = name
    end

    def validate
      validate_length(@name, NAME_SIZE[:min], NAME_SIZE[:max])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cb-core-0.1.10 lib/codebreaker/player.rb
cb-core-0.1.9 lib/codebreaker/player.rb
cb-core-0.1.8 lib/codebreaker/player.rb
cb-core-0.1.7 lib/codebreaker/player.rb