Class: Wiki2Go::GreyList::Suspect

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/Wiki2Go/GreyList.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, url) ⇒ Suspect

Returns a new instance of Suspect.



12
13
14
15
# File 'lib/Wiki2Go/GreyList.rb', line 12

def initialize(user,url)
  @user = user
  @url  = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/Wiki2Go/GreyList.rb', line 9

def url
  @url
end

#userObject (readonly)

Returns the value of attribute user.



10
11
12
# File 'lib/Wiki2Go/GreyList.rb', line 10

def user
  @user
end

Instance Method Details

#<=>(other) ⇒ Object



25
26
27
28
# File 'lib/Wiki2Go/GreyList.rb', line 25

def <=>(other)
  return false if other.nil?
  self.to_s <=> other.to_s
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/Wiki2Go/GreyList.rb', line 30

def eql?(other)
  return false if other.nil?
  self.to_s == other.to_s
end

#hashObject



21
22
23
# File 'lib/Wiki2Go/GreyList.rb', line 21

def hash
  self.to_s.hash
end

#to_sObject



17
18
19
# File 'lib/Wiki2Go/GreyList.rb', line 17

def to_s
  @user + ' ' + @url
end