summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-06-08 01:12:04 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-06-08 01:12:04 -0600
commit78997d077ef1a925e018473bd010f84eb2dafdf1 (patch)
treec6c2bdc44e3eb716f0f2d6c02dd759730d73a1ba /lib
parent9227919da7ac48b60a3218cbfb3c47b6a4fbd9bf (diff)
add respond_to_missing? method to html5 converter to complement method_missing
- when method_missing is define, respond_to_missing? should also be defined - add tests to verify result of respond_to? (which delegates to respond_to_missing?)
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/converter/html5.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/asciidoctor/converter/html5.rb b/lib/asciidoctor/converter/html5.rb
index 34c0b40b..926d5dc6 100644
--- a/lib/asciidoctor/converter/html5.rb
+++ b/lib/asciidoctor/converter/html5.rb
@@ -1332,8 +1332,12 @@ Your browser does not support the video tag.
end
# NOTE adapt to older converters that relied on unprefixed method names
- def method_missing id, *params
- !((name = id.to_s).start_with? 'convert_') && (handles? name) ? (send %(convert_#{name}), *params) : super
+ def method_missing id, *args
+ !((name = id.to_s).start_with? 'convert_') && (handles? name) ? (send %(convert_#{name}), *args) : super
+ end
+
+ def respond_to_missing? id, *options
+ !((name = id.to_s).start_with? 'convert_') && (handles? name)
end
end
end