Class: RubyToBlock::Block::CharacterEvent

Inherits:
CharacterMethodCall show all
Defined in:
app/models/concerns/ruby_to_block/block/character_event.rb

Constant Summary

Constants included from CharacterOperation

RubyToBlock::Block::CharacterOperation::CHAR_NAME_RE, RubyToBlock::Block::CharacterOperation::CHAR_RE

Instance Attribute Summary

Attributes included from CharacterOperation

#character

Attributes inherited from Base

#fields, #parent, #prev_sibling, #sibling, #statements, #values

Class Method Summary collapse

Methods inherited from CharacterMethodCall

add_character_method_call_block, process_match_data

Methods inherited from Base

#[], #add_statement, #add_value, blocknize, indent?, #indent_level, inherited, #initialize, inline?, #inline?, #null?, priority, process_else, process_match_data, process_value_string, regexp, statement?, #to_xml, type, #type, value?

Constructor Details

This class inherits a constructor from RubyToBlock::Block::Base

Class Method Details

.add_character_event_blocks(context, name, block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/concerns/ruby_to_block/block/character_event.rb', line 10

def self.add_character_event_blocks(context, name, block)
  do_block = Block.new('null')
  block.add_statement(:DO, do_block)

  character = get_character(context, name)
  context.character_stack.push(character)

  character_new_block, _ =
    add_child_or_create_character_new_block(context, name, block)

  context.receiver_stack.push(character)

  context.statement_stack.push([type, character_new_block])
  context.current_block = do_block
end

.process_end(context) ⇒ Object



4
5
6
7
8
# File 'app/models/concerns/ruby_to_block/block/character_event.rb', line 4

def self.process_end(context)
  context.receiver_stack.pop
  context.character_stack.pop
  super
end