Class: CMSScanner::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)


13
14
15
16
17
18
19
# File 'app/models/user.rb', line 13

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.



7
8
9
# File 'app/models/user.rb', line 7

def id
  @id
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'app/models/user.rb', line 6

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



7
8
9
# File 'app/models/user.rb', line 7

def username
  @username
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
24
25
# File 'app/models/user.rb', line 21

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

  username == other.username
end

#to_sObject



27
28
29
# File 'app/models/user.rb', line 27

def to_s
  username
end