Class: RText::DefaultCompleter::CompletionOption
- Inherits:
-
Object
- Object
- RText::DefaultCompleter::CompletionOption
- Defined in:
- lib/rtext/default_completer.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#display ⇒ Object
Returns the value of attribute display.
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#insert ⇒ Object
Returns the value of attribute insert.
Class Method Summary collapse
- .for_curly_braces(context) ⇒ Object
- .for_square_brackets ⇒ Object
- .from_text_extra(text, extra) ⇒ Object
Instance Method Summary collapse
-
#initialize(insert, display, description = nil, extra = nil) ⇒ CompletionOption
constructor
A new instance of CompletionOption.
- #text ⇒ Object
Constructor Details
#initialize(insert, display, description = nil, extra = nil) ⇒ CompletionOption
Returns a new instance of CompletionOption.
26 27 28 29 30 31 |
# File 'lib/rtext/default_completer.rb', line 26 def initialize(insert, display, description=nil, extra=nil) @insert = insert @display = display @description = description @extra = extra end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/rtext/default_completer.rb', line 12 def description @description end |
#display ⇒ Object
Returns the value of attribute display.
10 11 12 |
# File 'lib/rtext/default_completer.rb', line 10 def display @display end |
#extra ⇒ Object
Returns the value of attribute extra.
11 12 13 |
# File 'lib/rtext/default_completer.rb', line 11 def extra @extra end |
#insert ⇒ Object
Returns the value of attribute insert.
9 10 11 |
# File 'lib/rtext/default_completer.rb', line 9 def insert @insert end |
Class Method Details
.for_curly_braces(context) ⇒ Object
18 19 20 |
# File 'lib/rtext/default_completer.rb', line 18 def self.for_curly_braces(context) self.new("{\n#{context.line_indent}#{context.indent}||\n#{context.line_indent}}", '{}') end |
.for_square_brackets ⇒ Object
22 23 24 |
# File 'lib/rtext/default_completer.rb', line 22 def self.for_square_brackets self.new('[ || ]', '[]', '') end |
.from_text_extra(text, extra) ⇒ Object
14 15 16 |
# File 'lib/rtext/default_completer.rb', line 14 def self.from_text_extra(text, extra) self.new(text, text + ' ' + extra, nil, extra) end |
Instance Method Details
#text ⇒ Object
33 34 35 |
# File 'lib/rtext/default_completer.rb', line 33 def text @insert end |