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.
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
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/fuzz/entry.rb', line 4 def object @object end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/fuzz/entry.rb', line 4 def title @title end |
#weight ⇒ Object (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 |