Class: Fusuma::Plugin::Events::Records::TouchRecords::Base
- Inherits:
-
Record
- Object
- Record
- Fusuma::Plugin::Events::Records::TouchRecords::Base
- Defined in:
- lib/fusuma/plugin/events/records/touch_records/base.rb
Direct Known Subclasses
HoldRecord, PinchRecord, RotateRecord, SwipeRecord, TapRecord
Instance Attribute Summary collapse
-
#finger ⇒ Object
readonly
Returns the value of attribute finger.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #create_index_record(status: nil, trigger: :oneshot) ⇒ Object
-
#initialize(finger:) ⇒ Base
constructor
A new instance of Base.
- #repeatable? ⇒ Boolean
Constructor Details
#initialize(finger:) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 13 def initialize(finger:) super() @finger = finger.to_i end |
Instance Attribute Details
#finger ⇒ Object (readonly)
Returns the value of attribute finger.
11 12 13 |
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 11 def finger @finger end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 |
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 22 def ==(other) return false unless other.is_a?(self.class) @finger == other.finger end |
#create_index_record(status: nil, trigger: :oneshot) ⇒ Object
27 28 29 30 31 |
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 27 def create_index_record(status: nil, trigger: :oneshot) keys = config_index_keys keys << Config::Index::Key.new(status) if status Events::Records::IndexRecord.new(index: Config::Index.new(keys), trigger: trigger) end |
#repeatable? ⇒ Boolean
18 19 20 |
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 18 def repeatable? raise NotImplementedError end |