+ 1
RE: Modules, Mixins, Standard Classes Module 6 quiz
Effectively, can anyone answer this inquiry? Fill in the blanks to mix-in the module "Comparable". class Car attr_accessor :brand Comparable <=>(other) self.brand <=> other. end end
2 Answers
+ 2
Ans:
class Car
attr_accessor :brand
include Comparable
def<=>(other)
self.brand <=> other.brand
end
end
0
include Comparable
def<=>(other)
self.brand <=> other.brand
end