Class: LittleWire::Nunchuck::NunchuckFrame::Buttons
- Inherits:
-
Object
- Object
- LittleWire::Nunchuck::NunchuckFrame::Buttons
- Defined in:
- lib/littlewire/gadgets/nunchuck.rb
Instance Attribute Summary collapse
-
#c ⇒ Object
Returns the value of attribute c.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
-
#down?(button) ⇒ Boolean
is button down?.
-
#initialize(c, z) ⇒ Buttons
constructor
A new instance of Buttons.
- #inspect ⇒ Object
- #up?(button) ⇒ Boolean
Constructor Details
#initialize(c, z) ⇒ Buttons
Returns a new instance of Buttons.
86 87 88 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 86 def initialize c,z @c,@z = c,z end |
Instance Attribute Details
#c ⇒ Object
Returns the value of attribute c.
89 90 91 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 89 def c @c end |
#z ⇒ Object
Returns the value of attribute z.
89 90 91 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 89 def z @z end |
Instance Method Details
#down?(button) ⇒ Boolean
is button down?
92 93 94 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 92 def down? instance_variable_get("@#{.to_s.downcase}") end |
#inspect ⇒ Object
100 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 100 def inspect; "<Buttons:#{'C' if @c}#{'Z' if @z}>"; end |
#up?(button) ⇒ Boolean
96 97 98 |
# File 'lib/littlewire/gadgets/nunchuck.rb', line 96 def up? not down? end |