Sha256: 20aa1b31ae05c1dd56a674a1e700501b2a1fda4506524389bc88c90c9858a1af

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# encoding: utf-8
module RottenEgg
  class User
    @@users = {}
    attr_accessor :id
    attr_reader :name

    def initialize(name="rotten")
      @name = name
      @id   = 14720
    end

    def self.authenticate(username, password)
      if username == Application.auth_user["user"] && password == Application.auth_user["password"]
        usr             = User.new(username)
        @@users[usr.id] = usr
      else
        nil
      end
    end

    def self.auth?(username, password)
      username == Application.auth_user["user"] && password == Application.auth_user["password"]
    end

    def self.find(id)
      @@users[id]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rottenegg-1.2.5.beta lib/rotten_egg/user.rb