Class: TmSyntaxHighlighting::Config
- Inherits:
-
Object
- Object
- TmSyntaxHighlighting::Config
- Defined in:
- lib/tm_syntax_highlighting.rb
Constant Summary collapse
- @@attributes =
[:theme, :lang, :line_numbers, :current_themes]
Class Method Summary collapse
- .[](key) ⇒ Object
- .[]=(key, value) ⇒ Object
- .merge_with(opts) ⇒ Object
- .options ⇒ Object
- .reset_current_themes ⇒ Object
Class Method Details
.[](key) ⇒ Object
52 53 54 |
# File 'lib/tm_syntax_highlighting.rb', line 52 def [](key) self.send(key) end |
.[]=(key, value) ⇒ Object
56 57 58 |
# File 'lib/tm_syntax_highlighting.rb', line 56 def []=(key, value) self.send("#{key}=", value) end |
.merge_with(opts) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/tm_syntax_highlighting.rb', line 68 def merge_with(opts) opts = self..merge(opts) if opts[:theme].is_a?(Array) opts[:theme] = opts[:theme][rand(opts[:theme].size)] end opts end |
.options ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/tm_syntax_highlighting.rb', line 60 def opts = {} @@attributes.each do |attribute| opts[attribute] = self.send(attribute) end opts end |
.reset_current_themes ⇒ Object
76 77 78 |
# File 'lib/tm_syntax_highlighting.rb', line 76 def reset_current_themes self.current_themes = [] end |