Class: Deskbot::Event::MouseDown

Inherits:
Event
  • Object
show all
Defined in:
lib/deskbot/event.rb

Overview

A mouse button was pressed down. Exposes the pressed #button.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(button:, recorded_at:) ⇒ MouseDown

Returns a new instance of MouseDown.



87
88
89
90
# File 'lib/deskbot/event.rb', line 87

def initialize(button:, recorded_at:)
  @button = button
  @recorded_at = recorded_at
end

Instance Attribute Details

#button ⇒ Object (readonly)

Returns the value of attribute button.



85
86
87
# File 'lib/deskbot/event.rb', line 85

def button
  @button
end

Class Method Details

.build(payload) ⇒ Object



92
93
94
# File 'lib/deskbot/event.rb', line 92

def self.build(payload)
  new(button: payload["button"], recorded_at: recorded_at_from(payload))
end