Sha256: d40e542baac3f2f3c0c631f8cc33a87171dc8809e2c82f0da9b1a57bc9074436

Contents?: true

Size: 851 Bytes

Versions: 24

Compression:

Stored size: 851 Bytes

Contents

# -*- coding: utf-8 -*-
module RubyToBlock
  module Block
    # ハードウェアのメソッドや属性に共通するメソッドや定数を定義するモジュール
    module HardwareOperation
      extend ActiveSupport::Concern

      SMALRUBOT_RE = '(smalrubot_[^.]+)'
      DIO_PIN_RE = '\s*"(D(?:[2-9]|10|11|12|13))"\s*'
      PWM_PIN_RE = '\s*"(D(?:3|5|6|9|10|11))"\s*'
      AIO_PIN_RE = '\s*"(A[0-5])"\s*'
      TWO_WHEEL_DRIVE_CAR_PIN_RE = '\s*"(D[56])"\s*'
      LOR_RE = '(left|right)'
      ON_OFF_RE = '(turn_on|turn_off)'
      POR_RE = '(pressed|released)'
      ACTION_RE = '(forward|backward|turn_left|turn_right|stop)'

      included do
        attr_accessor :smalrubot_name
      end

      def type
        @type ||=
          (smalrubot_name ? super.gsub('smalrubot', smalrubot_name) : super)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
smalruby-editor-0.4.1-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.4.2-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.4.2 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.4.1 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.4.0-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.4.0 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.5-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.5 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.4-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.4 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.3-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.3 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.2-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.2 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.1-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.1 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.0-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.3.0 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.2.7-x86-mingw32 app/models/concerns/ruby_to_block/block/hardware_operation.rb
smalruby-editor-0.2.7 app/models/concerns/ruby_to_block/block/hardware_operation.rb