Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ComparablePlay
- include Comparable
- attr_accessor :attributes
- def initialize(attributes = {})
- self.attributes = attributes
- end
- def <=>(other_complaint)
- attributes.size <=> other_complaint.attributes.size
- end
- end
- class EnumerablePlay
- include Enumerable
- def initialize(attributes = {})
- @attributes = attributes
- end
- def give_me_nothing
- reject {|item| item.class == Array}
- end
- def each(&block)
- @attributes.each {|k, v| block.call(k, v)}
- end
- end
Add Comment
Please, Sign In to add comment