Class: Fuzz::Entry
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(title:, object:, weight:) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(title:, object:, weight:) ⇒ Entry
Returns a new instance of Entry.
7 8 9 10 11 |
# File 'lib/fuzz/entry.rb', line 7 def initialize(title:, object:, weight:) @title = title @object = object @weight = weight end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
5 6 7 |
# File 'lib/fuzz/entry.rb', line 5 def object @object end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/fuzz/entry.rb', line 5 def title @title end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
5 6 7 |
# File 'lib/fuzz/entry.rb', line 5 def weight @weight end |
Instance Method Details
#<=>(other) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/fuzz/entry.rb', line 13 def <=>(other) other_weight = other.weight if weight != other_weight other_weight <=> weight else title <=> other.title end end |