Class: GtkSource::SnippetContext

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtkSource::SnippetContext

Creates a new Gtk::SourceSnippetContext.

Generally, this isn't needed unless you are controlling the expansion of snippets manually.

Instance Method Details

#clear_variablesnil

Removes all variables from the context.

Returns:

  • (nil)

#expand(input) ⇒ String

Parameters:

  • input (String)

Returns:

  • (String)

#get_variable(key) ⇒ String

Gets the current value for a variable named key.

Parameters:

  • key (String)

    the name of the variable

Returns:

  • (String)

    the value for the variable, or nil

#line_prefix=(line_prefix) ⇒ nil

Parameters:

  • line_prefix (String)

Returns:

  • (nil)

#set_constant(key, value) ⇒ nil

Sets a constatnt within the context.

This is similar to a variable set with [methodSnippetContext.set_variable] but is expected to not change during use of the snippet.

Examples would be the date or users name.

Parameters:

  • key (String)

    the constant name

  • value (String)

    the value of the constant

Returns:

  • (nil)

#set_variable(key, value) ⇒ nil

Sets a variable within the context.

This variable may be overridden by future updates to the context.

Parameters:

  • key (String)

    the variable name

  • value (String)

    the value for the variable

Returns:

  • (nil)

#tab_width=(tab_width) ⇒ nil

Parameters:

  • tab_width (Integer)

Returns:

  • (nil)

#use_spaces=(use_spaces) ⇒ nil

Parameters:

  • use_spaces (Boolean)

Returns:

  • (nil)