Sha256: f9f02abbb41c3fd4041d4cf96750790690ec619e9f985154d9577c165fa32414
Contents?: true
Size: 1008 Bytes
Versions: 3
Compression:
Stored size: 1008 Bytes
Contents
class BlocklyInterpreter::ExtensionBlocks::ListsAppendBlock < BlocklyInterpreter::Block include BlocklyInterpreter::DSLGenerator self.block_type = :lists_append def execute_statement(execution_context) list = values['LIST'].value(execution_context) list << values['VALUE'].value(execution_context) end def to_dsl method_call_with_possible_block('lists_append', '', [ method_call_with_block_or_nothing('list', '', values['LIST']), method_call_with_block_or_nothing('item', '', values['VALUE']) ]) end module DSLMethods class ListsAppendBlockBuilder < BlocklyInterpreter::DSL::BlockBuilder def list(&proc) value("LIST", &proc) end def item(&proc) value("VALUE", &proc) end end def lists_append @blocks << BlocklyInterpreter::ExtensionBlocks::ListsAppendBlock::DSLMethods::ListsAppendBlockBuilder.new('lists_append').tap do |builder| builder.instance_exec(&proc) if proc end end end end
Version data entries
3 entries across 3 versions & 1 rubygems