Class: Srx::Format::BaseFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/srx/format/base_format.rb

Overview

Interface definition for format support

Direct Known Subclasses

Text, Xml

Instance Method Summary collapse

Instance Method Details

#end_formatting?(markup) ⇒ Boolean

This method is abstract.

Parameters:

  • markup (String)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/srx/format/base_format.rb', line 26

def end_formatting?(markup)
  raise(NotImplementedError)
end

#extract_markups(str) ⇒ Array(String,Array<Array(Integer,String)>)

This method is abstract.

Returns two items: 1) input str with markups removed, and 2) a list of markups, i.e. [pos, string] pairs.

Parameters:

  • str (String)

Returns:

  • (Array(String,Array<Array(Integer,String)>))

    two items: 1) input str with markups removed, and 2) a list of markups, i.e. [pos, string] pairs

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/srx/format/base_format.rb', line 12

def extract_markups(str)
  raise(NotImplementedError)
end

#isolated_formatting?(markup) ⇒ Boolean

This method is abstract.

Parameters:

  • markup (String)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/srx/format/base_format.rb', line 33

def isolated_formatting?(markup)
  raise(NotImplementedError)
end

#start_formatting?(markup) ⇒ Boolean

This method is abstract.

Parameters:

  • markup (String)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/srx/format/base_format.rb', line 19

def start_formatting?(markup)
  raise(NotImplementedError)
end