Class: Karabiner::Appdef
- Inherits:
-
Object
- Object
- Karabiner::Appdef
- Includes:
- XmlTree
- Defined in:
- lib/karabiner/appdef.rb
Constant Summary collapse
- AVAILABLE_OPTIONS =
%i[ equal prefix suffix ].freeze
Instance Method Summary collapse
-
#initialize(appname, options) ⇒ Appdef
constructor
A new instance of Appdef.
Methods included from XmlTree
#add_child, #search_childs, #to_xml
Constructor Details
#initialize(appname, options) ⇒ Appdef
Returns a new instance of Appdef.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/karabiner/appdef.rb', line 12 def initialize(appname, ) property = Karabiner::Property.new("appname", appname) add_child(property) .each do |option, value| raise "Unavailable option: #{property}" unless AVAILABLE_OPTIONS.include?(option) property = Karabiner::Property.new(option, value) add_child(property) end end |