+ 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

22nd Nov 2016, 7:17 PM
Miles Griffith
Miles Griffith - avatar
2 ответов
+ 2
Ans: class Car attr_accessor :brand include Comparable def<=>(other) self.brand <=> other.brand end end
21st May 2017, 2:45 PM
Mahnoor Shahzad
Mahnoor Shahzad - avatar
0
include Comparable def<=>(other) self.brand <=> other.brand end
22nd Nov 2016, 7:40 PM
Rill Chritty
Rill Chritty - avatar