Class: RushButton::DashButton

Inherits:
Object
  • Object
show all
Defined in:
lib/rush_button/dash_button.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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

#pressObject



13
14
15
# File 'lib/rush_button/dash_button.rb', line 13

def press
  return @process.call
end