Class: StreamdeckProf::ActionList
- Inherits:
-
Object
- Object
- StreamdeckProf::ActionList
- Defined in:
- lib/streamdeck_prof/action_list.rb
Instance Method Summary collapse
- #[](x, y) ⇒ Object
- #[]=(x, y, value) ⇒ Object
-
#initialize ⇒ ActionList
constructor
A new instance of ActionList.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize ⇒ ActionList
Returns a new instance of ActionList.
5 6 7 |
# File 'lib/streamdeck_prof/action_list.rb', line 5 def initialize @actions = {} end |
Instance Method Details
#[](x, y) ⇒ Object
9 10 11 |
# File 'lib/streamdeck_prof/action_list.rb', line 9 def [](x, y) @actions[coordinates(x, y)] end |
#[]=(x, y, value) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/streamdeck_prof/action_list.rb', line 13 def []=(x, y, value) key = coordinates(x, y) if value.nil? @actions.delete(key) else @actions[key] = value end end |
#to_hash ⇒ Object Also known as: to_h
22 23 24 |
# File 'lib/streamdeck_prof/action_list.rb', line 22 def to_hash @actions end |