Class: Fuzz::Entry

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/fuzz/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, object:, weight:) ⇒ Entry

Returns a new instance of Entry.



6
7
8
9
10
# File 'lib/fuzz/entry.rb', line 6

def initialize(title:, object:, weight:)
  @title = title
  @object = object
  @weight = weight
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/fuzz/entry.rb', line 4

def object
  @object
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/fuzz/entry.rb', line 4

def title
  @title
end

#weightObject (readonly)

Returns the value of attribute weight.



4
5
6
# File 'lib/fuzz/entry.rb', line 4

def weight
  @weight
end

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fuzz/entry.rb', line 12

def <=>(other)
  if weight != other.weight
    other.weight <=> weight
  else
    title <=> other.title
  end
end