Class: StreamdeckProf::Action

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Action

Returns a new instance of Action.



9
10
11
12
# File 'lib/streamdeck_prof/action.rb', line 9

def initialize(config)
  @config = config
  @files = FileList.new
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



7
8
9
# File 'lib/streamdeck_prof/action.rb', line 7

def config
  @config
end

#filesObject

Returns the value of attribute files.



7
8
9
# File 'lib/streamdeck_prof/action.rb', line 7

def files
  @files
end

Instance Method Details

#nameObject



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

def name
  config["Name"]
end

#name=(name) ⇒ Object



26
27
28
# File 'lib/streamdeck_prof/action.rb', line 26

def name=(name)
  config["Name"] = name
end

#save(storage_path) ⇒ Object



52
53
54
# File 'lib/streamdeck_prof/action.rb', line 52

def save(storage_path)
  files.save(storage_path)
end

#settingsObject



38
39
40
# File 'lib/streamdeck_prof/action.rb', line 38

def settings
  config["Settings"]
end

#settings=(settings) ⇒ Object



42
43
44
# File 'lib/streamdeck_prof/action.rb', line 42

def settings=(settings)
  config["Settings"] = settings
end

#stateObject



30
31
32
# File 'lib/streamdeck_prof/action.rb', line 30

def state
  config["State"]
end

#state=(state) ⇒ Object



34
35
36
# File 'lib/streamdeck_prof/action.rb', line 34

def state=(state)
  config["State"] = state
end

#to_hashObject Also known as: to_h



46
47
48
# File 'lib/streamdeck_prof/action.rb', line 46

def to_hash
  config
end

#uuidObject



14
15
16
# File 'lib/streamdeck_prof/action.rb', line 14

def uuid
  config["UUID"]
end

#uuid=(uuid) ⇒ Object



18
19
20
# File 'lib/streamdeck_prof/action.rb', line 18

def uuid=(uuid)
  config["UUID"] = uuid
end