Class: HappyTitles::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/happy-titles/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

#siteObject

Returns the value of attribute site.



4
5
6
# File 'lib/happy-titles/config.rb', line 4

def site
  @site
end

#taglineObject

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