Basically an Set, but with Order, ain’t that obivous?
# File lib/ramaze/snippets/ordered_set.rb, line 8 8: def self.[](*args) 9: new(*args) 10: end
Create new instances, optionally pass the first set
# File lib/ramaze/snippets/ordered_set.rb, line 13 13: def initialize(*args) 14: if args.size == 1 15: @set = args.shift 16: else 17: @set = *args 18: end 19: 20: @set ||= [] 21: @set = [@set] unless ::Array === @set 22: @set.uniq! 23: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.