Sha256: 3c7cf2b2551bdbe66bb16c7fb3dff7b2f466bc78f690c9021687f3b910310b4f

Contents?: true

Size: 413 Bytes

Versions: 3

Compression:

Stored size: 413 Bytes

Contents

module BlocklyInterpreter::BlockLibrary
  attr_accessor :block_classes

  def block_classes
    @block_classes ||= []
  end

  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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blockly_interpreter-0.3.0 lib/blockly_interpreter/block_library.rb
blockly_interpreter-0.2.1 lib/blockly_interpreter/block_library.rb
blockly_interpreter-0.2.0 lib/blockly_interpreter/block_library.rb