Class: YapShellAddonTabCompletion::Addon::CompletionResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, type:, descriptive_text: nil) ⇒ CompletionResult

Returns a new instance of CompletionResult.



15
16
17
18
19
# File 'lib/yap-shell-addon-tab-completion.rb', line 15

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.



13
14
15
# File 'lib/yap-shell-addon-tab-completion.rb', line 13

def descriptive_text
  @descriptive_text
end

#textObject

Returns the value of attribute text.



13
14
15
# File 'lib/yap-shell-addon-tab-completion.rb', line 13

def text
  @text
end

#typeObject

Returns the value of attribute type.



13
14
15
# File 'lib/yap-shell-addon-tab-completion.rb', line 13

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



25
26
27
# File 'lib/yap-shell-addon-tab-completion.rb', line 25

def <=>(other)
  @text <=> other.text
end

#==(other) ⇒ Object



21
22
23
# File 'lib/yap-shell-addon-tab-completion.rb', line 21

def ==(other)
  other.is_a?(self.class) && @text == other.text && @type == other.type
end

#to_sObject Also known as: to_str, inspect



29
30
31
# File 'lib/yap-shell-addon-tab-completion.rb', line 29

def to_s
  @text.to_s
end