Module: Wasmify::ExternalCommands
- Defined in:
- lib/wasmify/external_commands.rb
Class Attribute Summary collapse
-
.command ⇒ Object
readonly
Returns the value of attribute command.
Class Method Summary collapse
Class Attribute Details
.command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/wasmify/external_commands.rb', line 4 def command @command end |
Class Method Details
.any? ⇒ Boolean
20 |
# File 'lib/wasmify/external_commands.rb', line 20 def any? = !!command |
.register(*names) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wasmify/external_commands.rb', line 6 def register(*names) names.each do |name| module_eval <<~RUBY, __FILE__, __LINE__ + 1 def self.#{name}(...) raise ArgumentError, "Command has been already defined: #{command}" if command ::JS.global[:externalCommands].#{name}(...) @command = :#{name} end RUBY end end |