Module: Almanack::ServerContext::Helpers
- Defined in:
- lib/almanack/server/helpers.rb
Instance Method Summary collapse
-
#almanack_issues_url ⇒ Object
The URL to Almanack’s issues page.
-
#almanack_project_url ⇒ Object
The URL to Almanack’s project homepage.
-
#calendar ⇒ Object
The calendar.
-
#feed_url ⇒ Object
The URL to your consolidated iCal feed.
-
#now ⇒ Object
The current time.
-
#page_title(separator: " – ") ⇒ Object
The title of the page.
-
#title(value) ⇒ Object
Use to set the title of the page.
Instance Method Details
#almanack_issues_url ⇒ Object
Returns The URL to Almanack’s issues page.
15 16 17 |
# File 'lib/almanack/server/helpers.rb', line 15 def almanack_issues_url Almanack::ISSUES end |
#almanack_project_url ⇒ Object
Returns The URL to Almanack’s project homepage.
10 11 12 |
# File 'lib/almanack/server/helpers.rb', line 10 def almanack_project_url Almanack::HOMEPAGE end |
#calendar ⇒ Object
Returns The calendar.
25 26 27 |
# File 'lib/almanack/server/helpers.rb', line 25 def calendar @calendar ||= Almanack.calendar end |
#feed_url ⇒ Object
Returns The URL to your consolidated iCal feed.
5 6 7 |
# File 'lib/almanack/server/helpers.rb', line 5 def feed_url File.join(request.base_url, "#{settings.feed_path}.ics") end |
#now ⇒ Object
Returns The current time.
20 21 22 |
# File 'lib/almanack/server/helpers.rb', line 20 def now Time.now end |
#page_title(separator: " – ") ⇒ Object
Returns The title of the page.
30 31 32 |
# File 'lib/almanack/server/helpers.rb', line 30 def page_title(separator: " – ") [@title, calendar.title].compact.join(separator) end |
#title(value) ⇒ Object
Use to set the title of the page.
35 36 37 |
# File 'lib/almanack/server/helpers.rb', line 35 def title(value) @title = value end |