Class: Reline::Key
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Struct
|
|
Instance Chain:
self,
Struct
|
|
Inherits: |
Struct
|
Defined in: | lib/reline.rb |
Instance Attribute Summary
- #char rw
- #combined_char rw
- #with_meta rw
Instance Method Summary
-
#==(other)
Alias for #match?.
- #match?(other) ⇒ Boolean (also: #==)
Instance Attribute Details
#char (rw)
[ GitHub ]# File 'lib/reline.rb', line 19
Key = Struct.new('Key', :char, :combined_char, : )
#combined_char (rw)
[ GitHub ]# File 'lib/reline.rb', line 19
Key = Struct.new('Key', :char, :combined_char, : )
#with_meta (rw)
[ GitHub ]# File 'lib/reline.rb', line 19
Key = Struct.new('Key', :char, :combined_char, : )
Instance Method Details
#==(other)
Alias for #match?.
# File 'lib/reline.rb', line 33
alias_method :==, :match?
#match?(other) ⇒ Boolean
Also known as: #==
# File 'lib/reline.rb', line 20
def match?(other) case other when Reline::Key (other.char.nil? or char.nil? or char == other.char) and (other.combined_char.nil? or combined_char.nil? or combined_char == other.combined_char) and (other. .nil? or .nil? or == other. ) when Integer, Symbol (combined_char and combined_char == other) or (combined_char.nil? and char and char == other) else false end end