Class: YapShellAddonTabCompletion::CompletionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/yap-shell-addon-tab-completion/completion_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_textObject

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

#textObject

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

#typeObject

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_sObject 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