Module: Karabiner::DSL::Item
- Included in:
- Item
- Defined in:
- lib/karabiner/dsl/item.rb
Constant Summary
collapse
- AVAILABLE_PROPERTIES =
%i[
name
identifier
autogen
].freeze
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(property, value = '', options = {}) ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/karabiner/dsl/item.rb', line 36
def method_missing(property, value = '', options = {})
if AVAILABLE_PROPERTIES.include?(property)
property = Karabiner::Property.new(property, value, options)
add_child(property)
else
super
end
end
|
Instance Method Details
#execute(script) ⇒ Object
#invoke(application) ⇒ Object
#remap(target, options = {}) ⇒ Object
14
15
16
17
|
# File 'lib/karabiner/dsl/item.rb', line 14
def remap(target, options = {})
remap = Karabiner::Remap.new(target, options[:to])
add_child(remap)
end
|
#show_message(message) ⇒ Object
19
20
21
22
|
# File 'lib/karabiner/dsl/item.rb', line 19
def show_message(message)
property = Karabiner::Property.new("autogen", "__ShowStatusMessage__ #{message}")
add_child(property)
end
|