198: def insync?(is)
199:
200:
201: unless defined? @should and @should
202: return true
203: end
204:
205: unless @should.is_a?(Array)
206: self.devfail "%s's should is not array" % self.class.name
207: end
208:
209:
210: if @should.empty?
211: return true
212: end
213:
214:
215: if match_all?
216: return (is == @should or is == @should.collect { |v| v.to_s })
217: else
218: @should.each { |val|
219: if is == val or is == val.to_s
220: return true
221: end
222: }
223: end
224:
225:
226: return false
227: end