Sha256: e4f840cb4cdbd6b8d18a58383951764e38d393d7ef0a519bbde86f8ba3319b0f

Contents?: true

Size: 311 Bytes

Versions: 6

Compression:

Stored size: 311 Bytes

Contents

module Codebreaker
  class Player
    include Mixins::Validatable

    NAME_MIN_SIZE = 3
    NAME_MAX_SIZE = 20

    attr_reader :name

    def initialize(name)
      @name = name
      validate
    end

    private

    def validate
      validate_length(@name, NAME_MIN_SIZE, NAME_MAX_SIZE)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cb-core-0.1.6 lib/codebreaker/player.rb
cb-core-0.1.4 lib/codebreaker/player.rb
cb-core-0.1.3 lib/codebreaker/player.rb
cb-core-0.1.2 lib/codebreaker/player.rb
cb-core-0.1.1 lib/codebreaker/player.rb
cb-core-0.1.0 lib/codebreaker/player.rb