Module: Almanack::ServerContext::Helpers

Defined in:
lib/almanack/server/helpers.rb

Instance Method Summary collapse

Instance Method Details

#almanack_issues_urlObject

Returns The URL to Almanack’s issues page.

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_urlObject

Returns The URL to Almanack’s project homepage.

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

#calendarObject

Returns The calendar.

Returns:

  • The calendar.



25
26
27
# File 'lib/almanack/server/helpers.rb', line 25

def calendar
  @calendar ||= Almanack.calendar
end

#feed_urlObject

Returns The URL to your consolidated iCal feed.

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

#nowObject

Returns The current time.

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.

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