Created
May 20, 2009 20:04
-
-
Save lsegal/115055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YARD::Handlers::RemoteHandler < YARD::Handlers::Base | |
handles /\Aremote/ | |
def process | |
name_token = statement.tokens[2] | |
name = name_token.text.sub(/:/, '') | |
o1 = MethodObject.new(namespace, name, :instance) | |
o2 = MethodObject.new(namespace, "#{name}_cached", :instance) | |
register(o1, o2) | |
o1.visibiliy = :public | |
o1.parameters = [["params", "{}"]] | |
o1.docstring = [statement.comments, | |
"@see RemoteCall#remote", | |
"@return [String] Response"].join("\n") | |
o2.visibility = :public | |
o2.parameters = [["params", "{}"]] | |
o2.docstring = ["Cached version of #{name}", | |
"@see #{namespace}##{name}", | |
"@param params as in Alien#response", | |
"@return [String] response"].join("\n") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment