Sha256: 2909d193d924a8662db2ca1f62bdf017dbd0bde7cfc3b831a039a443980a655f

Contents?: true

Size: 353 Bytes

Versions: 3

Compression:

Stored size: 353 Bytes

Contents

class BlocklyInterpreter::CoreBlocks::TextBlock < BlocklyInterpreter::Block
  self.block_type = :text

  def text
    fields['TEXT']
  end

  def value(execution_context)
    text
  end

  def to_dsl
    "text #{text.inspect}"
  end

  module DSLMethods
    def text(content)
      block :text do
        field :TEXT, content
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blockly_interpreter-0.3.0 lib/blockly_interpreter/core_blocks/text_block.rb
blockly_interpreter-0.2.1 lib/blockly_interpreter/core_blocks/text_block.rb
blockly_interpreter-0.2.0 lib/blockly_interpreter/core_blocks/text_block.rb