Sha256: bbddcc6d23bca9aa78cf89d6f5a6bef2e52297fb86d8b7de778ebce16f9dac2d

Contents?: true

Size: 650 Bytes

Versions: 8

Compression:

Stored size: 650 Bytes

Contents

module RubyToBlock
  module Block
    class HardwareButtonDownOrUp < Value
      include CharacterOperation
      include HardwareOperation

      blocknize '^\s*' + CHAR_RE +
                'button\(' + DIO_PIN_RE + '\)\.(down|up)\?\s*$',
                value: true

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

        character = get_character(context, md2[1])
        return false if context.receiver && context.receiver != character

        block = new(fields: { PIN: md2[2], DOU: md2[3] })
        context.add_value(block)
        block.character = character

        true
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smalruby-editor-0.1.24-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.24 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.23-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.23 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.22-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.22 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.21-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb
smalruby-editor-0.1.21 app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb