Class: RushButton::DashButton
- Inherits:
-
Object
- Object
- RushButton::DashButton
- Defined in:
- lib/rush_button/dash_button.rb
Instance Attribute Summary collapse
-
#mac ⇒ Object
readonly
Returns the value of attribute mac.
Instance Method Summary collapse
-
#initialize(mac_addr) ⇒ DashButton
constructor
A new instance of DashButton.
- #on_press(&process) ⇒ Object
- #press ⇒ Object
Constructor Details
#initialize(mac_addr) ⇒ DashButton
Returns a new instance of DashButton.
4 5 6 |
# File 'lib/rush_button/dash_button.rb', line 4 def initialize mac_addr @mac = mac_addr end |
Instance Attribute Details
#mac ⇒ Object (readonly)
Returns the value of attribute mac.
3 4 5 |
# File 'lib/rush_button/dash_button.rb', line 3 def mac @mac end |
Instance Method Details
#on_press(&process) ⇒ Object
8 9 10 11 |
# File 'lib/rush_button/dash_button.rb', line 8 def on_press &process @process = process return self end |
#press ⇒ Object
13 14 15 |
# File 'lib/rush_button/dash_button.rb', line 13 def press return @process.call end |