Class: CMSScanner::Model::User

Inherits:
Object
  • Object
show all
Includes:
Finders::Finding
Defined in:
app/models/user.rb

Overview

User

Constant Summary

Constants included from Finders::Finding

Finders::Finding::FINDING_OPTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Finders::Finding

#<=>, #confidence, #confidence=, #confirmed_by, #eql?, included, #interesting_entries, #parse_finding_options

Constructor Details

#initialize(username, opts = {}) ⇒ User

Returns a new instance of User.

Parameters:

  • username (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :id (Integer)
  • :password (String)


16
17
18
19
20
21
22
# File 'app/models/user.rb', line 16

def initialize(username, opts = {})
  @username = username
  @password = opts[:password]
  @id       = opts[:id]

  parse_finding_options(opts)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'app/models/user.rb', line 10

def id
  @id
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'app/models/user.rb', line 9

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



10
11
12
# File 'app/models/user.rb', line 10

def username
  @username
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
27
28
# File 'app/models/user.rb', line 24

def ==(other)
  return false unless self.class == other.class

  username == other.username && password == other.password
end

#to_sObject



30
31
32
# File 'app/models/user.rb', line 30

def to_s
  username
end