Fix #327 - Don't break Module.hash

This commit is contained in:
Steve Bazyl 2015-12-20 14:39:11 -08:00
parent e8481dd14d
commit 4173efe67b
1 changed files with 3 additions and 2 deletions

View File

@ -76,7 +76,7 @@ module Google
options[:render_filter] = ->(value, _doc, *_args) { value.is_a?(DateTime) ? value.rfc3339(3) : value.to_s }
options[:parse_filter] = ->(fragment, _doc, *_args) { DateTime.parse(fragment) }
end
options[:render_nil] = true
options[:getter] = getter_fn(name)
options[:if] = if_fn(name)
@ -107,7 +107,8 @@ module Google
# @param [String] name
# Property name
# @param [Hash] options
def hash(name, options)
def hash(name = nil, options = nil)
return super() unless name # Allow Object.hash
set_default_options(name, options)
super(name, options)
end