Class: RubyToBlock::Block::HardwareSmalrubotActionWithSec

Inherits:
CharacterMethodCall show all
Includes:
HardwareOperation
Defined in:
app/models/concerns/ruby_to_block/block/hardware_smalrubot_action_with_sec.rb

Constant Summary

Constants included from HardwareOperation

RubyToBlock::Block::HardwareOperation::ACTION_RE, RubyToBlock::Block::HardwareOperation::AIO_PIN_RE, RubyToBlock::Block::HardwareOperation::DIO_PIN_RE, RubyToBlock::Block::HardwareOperation::LOR_RE, RubyToBlock::Block::HardwareOperation::ON_OFF_RE, RubyToBlock::Block::HardwareOperation::POR_RE, RubyToBlock::Block::HardwareOperation::PWM_PIN_RE, RubyToBlock::Block::HardwareOperation::SMALRUBOT_RE, RubyToBlock::Block::HardwareOperation::TWO_WHEEL_DRIVE_CAR_PIN_RE

Constants included from CharacterOperation

CharacterOperation::CHAR_NAME_RE, CharacterOperation::CHAR_RE

Constants inherited from Base

Base::STRING_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 included from HardwareOperation

#type

Methods inherited from CharacterMethodCall

add_character_method_call_block

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

.process_match_data(md, context) ⇒ Object

rubocop:enable LineLength



16
17
18
19
20
21
22
# File 'app/models/concerns/ruby_to_block/block/hardware_smalrubot_action_with_sec.rb', line 16

def self.process_match_data(md, context)
  md2 = regexp.match(md[type])
  block = new(fields: { ACTION: md2[3] })
  block.smalrubot_name = md2[2]
  add_character_method_call_block(context, md2[1], block, SEC: md2[4])
  true
end