mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove extra block body leftover from debug
Update docs to show example of default method implementation.
This commit is contained in:
parent
25f546245a
commit
d40040c8ee
1 changed files with 6 additions and 1 deletions
|
@ -39,6 +39,11 @@ module Spectator
|
||||||
# ```
|
# ```
|
||||||
# Double.define(SomeDouble, meth1: 42, meth2: "foobar") do
|
# Double.define(SomeDouble, meth1: 42, meth2: "foobar") do
|
||||||
# stub abstract def meth3 : Symbol
|
# stub abstract def meth3 : Symbol
|
||||||
|
#
|
||||||
|
# # Default implementation with a dynamic value.
|
||||||
|
# stub def meth4
|
||||||
|
# Time.utc
|
||||||
|
# end
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
macro define(type_name, name = nil, **value_methods, &block)
|
macro define(type_name, name = nil, **value_methods, &block)
|
||||||
|
@ -50,7 +55,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
{% if block %}{% block.body %}
|
{% if block %}
|
||||||
{% for expr in block.body.is_a?(Expressions) ? block.body.expressions : [block.body] %}
|
{% for expr in block.body.is_a?(Expressions) ? block.body.expressions : [block.body] %}
|
||||||
{% if expr.is_a?(Call) && expr.name == :stub.id %}
|
{% if expr.is_a?(Call) && expr.name == :stub.id %}
|
||||||
inject_{{expr}}
|
inject_{{expr}}
|
||||||
|
|
Loading…
Reference in a new issue