Sha256: d1848fdd2a6bc783c0dcb4e6473698c2323435860a167a5b3d26cbb99e235339
Contents?: true
Size: 1 KB
Versions: 46
Compression:
Stored size: 1 KB
Contents
# Blocklyが提供しているブロック <% category = 'math' %> <% n = "#{category}_number" %> Blockly.Ruby['<%= n %>'] = (block) -> code = parseFloat(@getFieldValue('NUM')) order = if code < 0 then Blockly.Ruby.ORDER_UNARY_MINUS_SIGN else Blockly.Ruby.ORDER_ATOMIC [code, order] <% category = 'text' %> <% n = "#{category}" %> Blockly.Ruby['<%= n %>'] = (block) -> code = Blockly.Ruby.quote_(@getFieldValue('TEXT')) [code, Blockly.Ruby.ORDER_ATOMIC] # 変数 <% category = 'variables' %> # [▼](変数) <% n = "#{category}_get" %> Blockly.Ruby['<%= n %>'] = (block) -> name = Blockly.Ruby.variableDB_.getName(block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE) [name, Blockly.Ruby.ORDER_ATOMIC] # セット[▼]宛先 <% n = "#{category}_set" %> Blockly.Ruby['<%= n %>'] = (block) -> val = Blockly.Ruby.valueToCode(block, 'VALUE', Blockly.Ruby.ORDER_NONE) || '0' name = Blockly.Ruby.variableDB_.getName(block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE) name + ' = ' + val + '\n'
Version data entries
46 entries across 46 versions & 1 rubygems