Class: RubyToBlock::Block::CharacterMethodCall

Inherits:
Base
  • Object
show all
Includes:
CharacterOperation
Defined in:
app/models/concerns/ruby_to_block/block/character_method_call.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 Base

#[], #add_statement, #add_value, blocknize, indent?, #indent_level, inherited, #initialize, inline?, #inline?, #null?, priority, process_else, process_end, 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_method_call_block(context, name, block, values = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/concerns/ruby_to_block/block/character_method_call.rb', line 16

def self.add_character_method_call_block(context, name, block,
                                         values = {})
  _, context.current_block =
    *add_child_or_create_character_new_block(context, name, block)

  values.each do |k, v|
    process_value_string(context, block, v, k)
  end

  block
end

.process_match_data(md, context) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/models/concerns/ruby_to_block/block/character_method_call.rb', line 6

def self.process_match_data(md, context)
  md2 = regexp.match(md[type])

  block = new
  _, context.current_block =
    *add_child_or_create_character_new_block(context, md2[1], block)

  true
end