Class: YapShellAddonTabCompletion::CompletionResult
- Inherits:
-
Object
- Object
- YapShellAddonTabCompletion::CompletionResult
- Defined in:
- lib/yap-shell-addon-tab-completion/completion_result.rb
Instance Attribute Summary collapse
-
#descriptive_text ⇒ Object
Returns the value of attribute descriptive_text.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(text:, type:, descriptive_text: nil) ⇒ CompletionResult
constructor
A new instance of CompletionResult.
- #to_s ⇒ Object (also: #to_str, #inspect)
Constructor Details
#initialize(text:, type:, descriptive_text: nil) ⇒ CompletionResult
Returns a new instance of CompletionResult.
5 6 7 8 9 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 5 def initialize(text:, type:, descriptive_text: nil) @descriptive_text = descriptive_text || text @text = text @type = type end |
Instance Attribute Details
#descriptive_text ⇒ Object
Returns the value of attribute descriptive_text.
3 4 5 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 3 def descriptive_text @descriptive_text end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 3 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 3 def type @type end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 15 def <=>(other) @text <=> other.text end |
#==(other) ⇒ Object
11 12 13 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 11 def ==(other) other.is_a?(self.class) && @text == other.text && @type == other.type end |
#to_s ⇒ Object Also known as: to_str, inspect
19 20 21 |
# File 'lib/yap-shell-addon-tab-completion/completion_result.rb', line 19 def to_s @text.to_s end |