Module: BlocklyInterpreter::BlockLibrary

Included in:
CoreBlocks, ExtensionBlocks
Defined in:
lib/blockly_interpreter/block_library.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#block_classesObject

Returns the value of attribute block_classes.



2
3
4
# File 'lib/blockly_interpreter/block_library.rb', line 2

def block_classes
  @block_classes
end

Instance Method Details

#register!(parser_class = BlocklyInterpreter::Parser, block_context_class = BlocklyInterpreter::DSL::BlockContext) ⇒ Object



8
9
10
11
12
13
# File 'lib/blockly_interpreter/block_library.rb', line 8

def register!(parser_class = BlocklyInterpreter::Parser, block_context_class = BlocklyInterpreter::DSL::BlockContext)
  block_classes.each do |block_class|
    parser_class.register_block_class block_class
    block_context_class.register_block_class block_class
  end
end