Class: RubyToBlock::Block::HardwareTwoWheelDriveCar

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

Constant Summary

Constants included from CharacterOperation

CharacterOperation::CHAR_NAME_RE, CharacterOperation::CHAR_RE

Constants inherited from Base

Base::STRING_RE

Instance Attribute Summary collapse

Attributes included from CharacterOperation

#character

Attributes inherited from Base

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

Class Method Summary collapse

Instance Method Summary collapse

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, value?

Constructor Details

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

Instance Attribute Details

#method_nameObject

rubocop:enable LineLength



10
11
12
# File 'app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb', line 10

def method_name
  @method_name
end

Class Method Details

.process_match_data(md, context) ⇒ Object



12
13
14
15
16
17
18
19
# File 'app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb', line 12

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

Instance Method Details

#typeObject



21
22
23
# File 'app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb', line 21

def type
  "hardware_two_wheel_drive_car_#{method_name}"
end