Class: Coursemology::Polyglot::Language
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Coursemology::Polyglot::Language
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/coursemology/polyglot/language.rb,
lib/coursemology/polyglot/language.rb,
lib/coursemology/polyglot/language.rb
Overview
An abstract language. This is a class which can represent a family of languages. Languages become concrete and can be used when that language includes Coursemology::Polyglot::ConcreteLanguage.
Languages define their own scripts and stylesheets needed to syntax highlight code.
Each subclass represents a language ancestry, such as differing language versions (see the Python language definition.) Derived languages can be defined at runtime to utilise the syntax highlighting capabilities of the root language, while requiring a separate runtime environment to run programs written in the derived language.
Do NOT remove languages after they have been defined because the types specified in this library can have references stored in code (e.g. in a database)
Direct Known Subclasses
Defined Under Namespace
Classes: CPlusPlus, Java, JavaScript, Python
Class Method Summary collapse
-
.ace_mode ⇒ String
abstract
The Ace mode to use with this language.
-
.concrete_languages ⇒ Array<Class>
Determines the concrete language subclasses of this language.
-
.display_name ⇒ String
abstract
Gets the display name of the language.
-
.rouge_lexer ⇒ String
abstract
The Rouge lexer to use with this language.
Class Method Details
.ace_mode ⇒ String
The Ace mode to use with this language.
108 109 110 |
# File 'lib/coursemology/polyglot/language.rb', line 108 def self.ace_mode fail NotImplementedError end |
.concrete_languages ⇒ Array<Class>
Determines the concrete language subclasses of this language.
57 58 59 60 61 |
# File 'lib/coursemology/polyglot/language.rb', line 57 def self.concrete_languages descendants.select do |klass| klass.ancestors.include?(Coursemology::Polyglot::ConcreteLanguage) end end |
.display_name ⇒ String
Gets the display name of the language.
92 93 94 |
# File 'lib/coursemology/polyglot/language.rb', line 92 def self.display_name fail NotImplementedError end |
.rouge_lexer ⇒ String
The Rouge lexer to use with this language.
100 101 102 |
# File 'lib/coursemology/polyglot/language.rb', line 100 def self.rouge_lexer fail NotImplementedError end |