Sha256: 13eb0dd25a2b6afec9f050bd33d4dd80f57016dbcb5ef0f039484320f436e357

Contents?: true

Size: 301 Bytes

Versions: 1

Compression:

Stored size: 301 Bytes

Contents

class User
  attr_accessor :used_attempts, :used_hints
  attr_reader :name

  def initialize(name)
    return unless valid?(name)

    @name = name
    @used_attempts = 0
    @used_hints = 0
  end

  private

  def valid?(name)
    return true if name.match(/[A-Za-z0-9_]{3,20}/)

    false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codebreaker_karolina-0.1.4 lib/modules/user.rb