Class: Keyremac::Autogen::KeyOverlaidModifier
- Inherits:
-
Object
- Object
- Keyremac::Autogen::KeyOverlaidModifier
- Defined in:
- lib/keyremac/base.rb,
lib/keyremac/dump.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
-
#repeat ⇒ Object
readonly
Returns the value of attribute repeat.
Instance Method Summary collapse
- #dump(xml) ⇒ Object
-
#initialize(key, mod, keys: [], repeat: false) ⇒ KeyOverlaidModifier
constructor
A new instance of KeyOverlaidModifier.
- #repeat? ⇒ Boolean
Constructor Details
#initialize(key, mod, keys: [], repeat: false) ⇒ KeyOverlaidModifier
Returns a new instance of KeyOverlaidModifier.
29 30 31 32 33 34 |
# File 'lib/keyremac/base.rb', line 29 def initialize(key, mod, keys: [], repeat: false) @key = key @mod = mod @keys = keys == [] ? [key] : keys @repeat = repeat end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
28 29 30 |
# File 'lib/keyremac/base.rb', line 28 def key @key end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
28 29 30 |
# File 'lib/keyremac/base.rb', line 28 def keys @keys end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
28 29 30 |
# File 'lib/keyremac/base.rb', line 28 def mod @mod end |
#repeat ⇒ Object (readonly)
Returns the value of attribute repeat.
28 29 30 |
# File 'lib/keyremac/base.rb', line 28 def repeat @repeat end |
Instance Method Details
#dump(xml) ⇒ Object
52 53 54 55 56 |
# File 'lib/keyremac/dump.rb', line 52 def dump(xml) seqs = [key, mod, *keys].map { |k| k.dump(xml) }.join(', ') autogen = repeat ? '__KeyOverlaidModifierWithRepeat__' : '__KeyOverlaidModifier__' xml.autogen "#{autogen} #{seqs}" end |
#repeat? ⇒ Boolean
36 37 38 |
# File 'lib/keyremac/base.rb', line 36 def repeat? @repeat end |