diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-06-08 01:12:04 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2021-06-08 01:12:04 -0600 |
| commit | 78997d077ef1a925e018473bd010f84eb2dafdf1 (patch) | |
| tree | c6c2bdc44e3eb716f0f2d6c02dd759730d73a1ba /lib | |
| parent | 9227919da7ac48b60a3218cbfb3c47b6a4fbd9bf (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.rb | 8 |
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 |
