Module: PageTitleHelper::Interpolations
- Extended by:
- Interpolations
- Included in:
- Interpolations
- Defined in:
- lib/page_title_helper.rb
Overview
Class Method Summary (collapse)
Instance Method Summary (collapse)
Class Method Details
+ (Object) interpolate(pattern, *args)
19 20 21 22 23 24 25 |
# File 'lib/page_title_helper.rb', line 19 def self.interpolate(pattern, *args) instance_methods(false).sort.reverse.inject(pattern.to_s.dup) do |result, tag| result.gsub(/:#{tag}/) do |match| send(tag, *args) end end end |
Instance Method Details
- (Object) app(env)
27 28 29 |
# File 'lib/page_title_helper.rb', line 27 def app(env) env[:app] || I18n.translate(:app.name', :default => File.basename(Rails.root).humanize) end |
- (Object) title(env)
31 32 33 |
# File 'lib/page_title_helper.rb', line 31 def title(env) env[:title] end |