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) ⇒ Object
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
21 22 23 |
# File 'lib/pageflow/themes.rb', line 21 def each(&block) @themes.values.each(&block) end |
#get(name) ⇒ Object
13 14 15 |
# File 'lib/pageflow/themes.rb', line 13 def get(name) @themes.fetch(name) { raise(ArgumentError, "Unknown theme '#{name}'.") } end |
#names ⇒ Object
17 18 19 |
# File 'lib/pageflow/themes.rb', line 17 def names map(&:name) end |