提交 a88094fd 编写于 作者: J Jeremy Kemper

No need to have #generate and #generate_extras per instance

上级 6599dd90
...@@ -122,6 +122,16 @@ def freeze ...@@ -122,6 +122,16 @@ def freeze
super super
end end
def generate(options, hash, expire_on = {})
path, hash = generate_raw(options, hash, expire_on)
append_query_string(path, hash, extra_keys(options))
end
def generate_extras(options, hash, expire_on = {})
path, hash = generate_raw(options, hash, expire_on)
[path, extra_keys(options)]
end
private private
def requirement_for(key) def requirement_for(key)
return requirements[key] if requirements.key? key return requirements[key] if requirements.key? key
...@@ -150,11 +160,6 @@ def write_generation! ...@@ -150,11 +160,6 @@ def write_generation!
# the query string. (Never use keys from the recalled request when building the # the query string. (Never use keys from the recalled request when building the
# query string.) # query string.)
method_decl = "def generate(#{args})\npath, hash = generate_raw(options, hash, expire_on)\nappend_query_string(path, hash, extra_keys(options))\nend"
instance_eval method_decl, "generated code (#{__FILE__}:#{__LINE__})"
method_decl = "def generate_extras(#{args})\npath, hash = generate_raw(options, hash, expire_on)\n[path, extra_keys(options)]\nend"
instance_eval method_decl, "generated code (#{__FILE__}:#{__LINE__})"
raw_method raw_method
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册