lib/bindata/deprecated.rb in bindata-0.11.0 vs lib/bindata/deprecated.rb in bindata-0.11.1
- old
+ new
@@ -137,11 +137,11 @@
end
end
alias_method :orig_offset_of, :offset_of
def offset_of(child)
- if child.class == ::String
- fail "error: 'offset_of(\"fieldname\")' is deprecated. Use 'fieldname.offset' instead"
+ if child.is_a?(::String) or child.is_a?(Symbol)
+ fail "error: 'offset_of(#{child.inspect})' is deprecated. Use '#{child.to_s}.offset' instead"
end
orig_offset_of(child)
end
end
end