Sha256: c84037f13906a86ba136bb66d4be2013c35ac4cbd10155ebdc7aac528680ba4f
Contents?: true
Size: 614 Bytes
Versions: 54
Compression:
Stored size: 614 Bytes
Contents
# Thanks ruby on rails! # # These are all blatent, unapologetic rip offs of RoR extensions, and they # behave in exactly the same way. class Object def blank? respond_to?(:empty?) ? empty? : !self end def present? !blank? end # okay, this is strange, but `rake spec` fails if I define the method as `in?` # but passes if I alias it, as I do below. weird, but I don't want to fight # it. def __in_workaround(args) args.include?(self) rescue NoMethodError raise ArgumentError.new("The parameter passed to #in? must respond to #include?") end alias in? __in_workaround end
Version data entries
54 entries across 54 versions & 1 rubygems