Class: USaidWat::Algorithms::Algorithm
- Inherits:
-
Object
- Object
- USaidWat::Algorithms::Algorithm
- Defined in:
- lib/usaidwat/algo.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#buckets ⇒ Object
readonly
Returns the value of attribute buckets.
Instance Method Summary collapse
-
#initialize(buckets) ⇒ Algorithm
constructor
A new instance of Algorithm.
- #sort(a, b) ⇒ Object
Constructor Details
#initialize(buckets) ⇒ Algorithm
Returns a new instance of Algorithm.
6 7 8 |
# File 'lib/usaidwat/algo.rb', line 6 def initialize(buckets) @buckets = buckets end |
Instance Attribute Details
#buckets ⇒ Object (readonly)
Returns the value of attribute buckets.
4 5 6 |
# File 'lib/usaidwat/algo.rb', line 4 def buckets @buckets end |
Instance Method Details
#sort(a, b) ⇒ Object
10 11 12 |
# File 'lib/usaidwat/algo.rb', line 10 def sort(a, b) a <=> b end |