Sha256: 2ba25260dc9067817ec27a5d27c6e619c7dc806d0482676fae6acbf25d33670e

Contents?: true

Size: 442 Bytes

Versions: 4

Compression:

Stored size: 442 Bytes

Contents

module AuthLh
  class User
    attr_accessor :code, :email, :jabber, :name, :login, :shop_code,
      :shop_id, :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.7.0 lib/auth_lh/user.rb
auth-lh-0.6.1 lib/auth_lh/user.rb
auth-lh-0.6.0 lib/auth_lh/user.rb
auth-lh-0.5.0 lib/auth_lh/user.rb