Class: Spacy::KeyStroke
- Inherits:
-
Object
- Object
- Spacy::KeyStroke
- Includes:
- Comparable
- Defined in:
- lib/spacy/keystroke.rb
Instance Method Summary collapse
- #<=>(obj) ⇒ Object
- #eql?(obj) ⇒ Boolean
- #hash ⇒ Object
-
#initialize ⇒ KeyStroke
constructor
A new instance of KeyStroke.
- #push(key) ⇒ Object (also: #<<)
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ KeyStroke
Returns a new instance of KeyStroke.
11 12 13 |
# File 'lib/spacy/keystroke.rb', line 11 def initialize () @keys = [] end |
Instance Method Details
#<=>(obj) ⇒ Object
33 34 35 |
# File 'lib/spacy/keystroke.rb', line 33 def <=> (obj) to_s <=> obj.to_s end |
#eql?(obj) ⇒ Boolean
29 30 31 |
# File 'lib/spacy/keystroke.rb', line 29 def eql? (obj) to_s == obj.to_s end |
#hash ⇒ Object
25 26 27 |
# File 'lib/spacy/keystroke.rb', line 25 def hash () to_s.hash end |
#push(key) ⇒ Object Also known as: <<
19 20 21 |
# File 'lib/spacy/keystroke.rb', line 19 def push (key) @keys << key end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/spacy/keystroke.rb', line 15 def to_s () @keys.join end |