lib/daijobu/scheme_set.rb in sander6-daijobu-0.1.1 vs lib/daijobu/scheme_set.rb in sander6-daijobu-0.2.0
- old
+ new
@@ -3,11 +3,13 @@
DEFAULT = [ :marshal, :json, :yaml, :eval ]
attr_reader :current
- def initialize(*schemes)
- @schemes = (schemes.empty? ? DEFAULT : schemes).collect { |scheme| Daijobu::Scheme.get(scheme) }
+ def initialize(schemes = nil)
+ schemes = Array(schemes)
+ schemes = DEFAULT if schemes.empty?
+ @schemes = schemes.collect { |scheme| Daijobu::Scheme.get(scheme) }
@current = 0
end
def next
scheme = @schemes[@current]
\ No newline at end of file