1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Fix the inherited_hash documentation for YARD 0.4.

This commit is contained in:
Nathan Weizenbaum 2010-01-16 16:44:56 -08:00
parent 9be277966f
commit 0ee9db5b53

View file

@ -1,4 +1,4 @@
class InheritedHashHandler < YARD::Handlers::Base
class InheritedHashHandler < YARD::Handlers::Ruby::Legacy::Base
handles /\Ainherited_hash(\s|\()/
def process
@ -6,39 +6,36 @@ class InheritedHashHandler < YARD::Handlers::Base
name = statement.comments.first.strip
type = statement.comments[1].strip
register(MethodObject.new(namespace, hash_name, scope)) do |o|
o.docstring = [
"Gets a #{name} from this {Environment} or one of its \\{#parent}s.",
"@param name [String] The name of the #{name}",
"@return [#{type}] The #{name} value",
]
o.signature = true
o.parameters = ["name"]
end
o = register(MethodObject.new(namespace, hash_name, scope))
o.docstring = [
"Gets a #{name} from this {Environment} or one of its \\{#parent}s.",
"@param name [String] The name of the #{name}",
"@return [#{type}] The #{name} value",
]
o.signature = true
o.parameters = ["name"]
register(MethodObject.new(namespace, "set_#{hash_name}", scope)) do |o|
o.docstring = [
"Sets a #{name} in this {Environment} or one of its \\{#parent}s.",
"If the #{name} is already defined in some environment,",
"that one is set; otherwise, a new one is created in this environment.",
"@param name [String] The name of the #{name}",
"@param value [#{type}] The value of the #{name}",
"@return [#{type}] `value`",
]
o.signature = true
o.parameters = ["name", "value"]
end
o = register(MethodObject.new(namespace, "set_#{hash_name}", scope))
o.docstring = [
"Sets a #{name} in this {Environment} or one of its \\{#parent}s.",
"If the #{name} is already defined in some environment,",
"that one is set; otherwise, a new one is created in this environment.",
"@param name [String] The name of the #{name}",
"@param value [#{type}] The value of the #{name}",
"@return [#{type}] `value`",
]
o.signature = true
o.parameters = ["name", "value"]
register(MethodObject.new(namespace, "set_local_#{hash_name}", scope)) do |o|
o.docstring = [
"Sets a #{name} in this {Environment}.",
"Ignores any parent environments.",
"@param name [String] The name of the #{name}",
"@param value [#{type}] The value of the #{name}",
"@return [#{type}] `value`",
]
o.signature = true
o.parameters = ["name", "value"]
end
o = register(MethodObject.new(namespace, "set_local_#{hash_name}", scope))
o.docstring = [
"Sets a #{name} in this {Environment}.",
"Ignores any parent environments.",
"@param name [String] The name of the #{name}",
"@param value [#{type}] The value of the #{name}",
"@return [#{type}] `value`",
]
o.signature = true
o.parameters = ["name", "value"]
end
end