Sha256: 387bb8a84096aa2f76780d58950eb238f49f0f12fc7681eafa94b25f1d485ecd

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

module AuthLh
  class User
    attr_accessor :code, :email, :jabber, :name, :login, :shop_code,
      :enabled, :role_codes, :password_expired, :birthdate, :dni

    def initialize(attributes={})
      attributes.each do |k,v|
        self.send("#{k}=", v)
      end
    end

    def password_expired?
      password_expired == true
    end

    def has_role?(role_code)
      role_codes.include?(role_code.to_s)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
auth-lh-0.4.2 lib/auth_lh/user.rb
auth-lh-0.4.1 lib/auth_lh/user.rb
auth-lh-0.4.0 lib/auth_lh/user.rb
auth-lh-0.3.2 lib/auth_lh/user.rb