Which programming language is this?
class Version
include Comparable
attr_reader :major
def initialize(major)
@major = major
end
def <=>(other)
major <=> other.major
end
end
Answer: Ruby
Mixing in
Play Programming Languages ▸
Comparable with include, attr_reader :major, @major and defining the <=> operator method are Ruby.