Class: StreamdeckProf::ActionList

Inherits:
Object
  • Object
show all
Defined in:
lib/streamdeck_prof/action_list.rb

Instance Method Summary collapse

Constructor Details

#initializeActionList

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_hashObject Also known as: to_h



22
23
24
# File 'lib/streamdeck_prof/action_list.rb', line 22

def to_hash
  @actions
end