Class: Fusuma::Plugin::Events::Records::TouchRecords::Base

Inherits:
Record
  • Object
show all
Defined in:
lib/fusuma/plugin/events/records/touch_records/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fingerObject (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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/fusuma/plugin/events/records/touch_records/base.rb', line 18

def repeatable?
  raise NotImplementedError
end