Class: Pageflow::Themes
- Inherits:
-
Object
- Object
- Pageflow::Themes
- Includes:
- Enumerable
- Defined in:
- lib/pageflow/themes.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #get(name) ⇒ Object
-
#initialize ⇒ Themes
constructor
A new instance of Themes.
- #names ⇒ Object
-
#register(name, options = {}) ⇒ Object
Register a theme and supply theme options.
Constructor Details
#initialize ⇒ Themes
Returns a new instance of Themes.
5 6 7 |
# File 'lib/pageflow/themes.rb', line 5 def initialize @themes = HashWithIndifferentAccess.new end |
Instance Method Details
#each(&block) ⇒ Object
55 56 57 |
# File 'lib/pageflow/themes.rb', line 55 def each(&block) @themes.values.each(&block) end |
#get(name) ⇒ Object
47 48 49 |
# File 'lib/pageflow/themes.rb', line 47 def get(name) @themes.fetch(name) { raise(ArgumentError, "Unknown theme '#{name}'.") } end |
#names ⇒ Object
51 52 53 |
# File 'lib/pageflow/themes.rb', line 51 def names map(&:name) end |