Class: TTY::Markdown::Theme Private
- Inherits:
-
Object
- Object
- TTY::Markdown::Theme
- Defined in:
- lib/tty/markdown/theme.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for storing the theme configuration
Class Method Summary collapse
-
.from(theme) ⇒ TTY::Markdown::Theme
Create a Theme instance.
Instance Method Summary collapse
-
#[](name) ⇒ Array<Symbol>
Fetch styles by element name.
-
#initialize(theme) ⇒ Theme
constructor
private
Create a Theme instance.
Constructor Details
#initialize(theme) ⇒ Theme
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a TTY::Markdown::Theme instance
138 139 140 |
# File 'lib/tty/markdown/theme.rb', line 138 def initialize(theme) @theme = theme end |
Class Method Details
.from(theme) ⇒ TTY::Markdown::Theme
Create a TTY::Markdown::Theme instance
55 56 57 |
# File 'lib/tty/markdown/theme.rb', line 55 def self.from(theme) new(validate_names(build_theme(theme))) end |
Instance Method Details
#[](name) ⇒ Array<Symbol>
Fetch styles by element name
154 155 156 |
# File 'lib/tty/markdown/theme.rb', line 154 def [](name) @theme[name] end |