Class: HappyTitles::Config
- Inherits:
-
Object
- Object
- HappyTitles::Config
- Defined in:
- lib/happy-titles/config.rb
Instance Attribute Summary collapse
-
#site ⇒ Object
Returns the value of attribute site.
-
#tagline ⇒ Object
Returns the value of attribute tagline.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #template(key = :default) ⇒ Object
- #templates(&block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 |
# File 'lib/happy-titles/config.rb', line 6 def initialize @site = DEFAULT_SITE @tagline = DEFAULT_TAGLINE @template_set = HappyTitles::TemplateSet.new(default_template) end |
Instance Attribute Details
#site ⇒ Object
Returns the value of attribute site.
4 5 6 |
# File 'lib/happy-titles/config.rb', line 4 def site @site end |
#tagline ⇒ Object
Returns the value of attribute tagline.
4 5 6 |
# File 'lib/happy-titles/config.rb', line 4 def tagline @tagline end |
Instance Method Details
#template(key = :default) ⇒ Object
12 13 14 |
# File 'lib/happy-titles/config.rb', line 12 def template(key = :default) template_set.get(key) end |
#templates(&block) ⇒ Object
16 17 18 |
# File 'lib/happy-titles/config.rb', line 16 def templates(&block) template_set.instance_eval(&block) end |