Module: Dubs
- Defined in:
- lib/dubs.rb,
lib/dubs/data.rb,
lib/dubs/theme.rb,
lib/dubs/token.rb,
lib/dubs/pattern.rb,
lib/dubs/version.rb,
lib/dubs/generator.rb
Defined Under Namespace
Modules: Data, Pattern, Token Classes: CategoryNotFound, Error, Generator, PatternNotFound, Theme, ThemeNotFound
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.generate(**options) ⇒ Object
Generate a random name.
-
.register_theme(**data) ⇒ Object
Register a custom theme from a hash.
-
.register_theme_file(path) ⇒ Object
Register a custom theme from a JSON file.
-
.theme(name) ⇒ Object
Get a theme by name.
-
.themes ⇒ Object
List available theme names.
Class Method Details
.generate(**options) ⇒ Object
26 27 28 |
# File 'lib/dubs.rb', line 26 def generate(**) Generator.new(**).generate end |
.register_theme(**data) ⇒ Object
Register a custom theme from a hash.
Dubs.register_theme(name: :battletech, display_name: "BattleTech", categories: { ... }, default_category: "mechs")
52 53 54 |
# File 'lib/dubs.rb', line 52 def register_theme(**data) Data.register_theme(**data) end |
.register_theme_file(path) ⇒ Object
Register a custom theme from a JSON file.
Dubs.register_theme_file("/path/to/battletech.json")
60 61 62 |
# File 'lib/dubs.rb', line 60 def register_theme_file(path) Data.register_theme_file(path) end |
.theme(name) ⇒ Object
Get a theme by name.
Dubs.theme(:gundam).categories
# => [:mobile_suits, :characters, :ships]
44 45 46 |
# File 'lib/dubs.rb', line 44 def theme(name) Data.theme(name) end |
.themes ⇒ Object
List available theme names.
Dubs.themes
# => [:gundam, :star_trek]
35 36 37 |
# File 'lib/dubs.rb', line 35 def themes Data.theme_names end |