Module: SiteLogic

Defined in:
lib/site_logic.rb,
lib/site_logic/railtie.rb,
lib/site_logic/navigation.rb

Defined Under Namespace

Modules: SiteLogic Classes: Navigation, Railtie

Class Method Summary collapse

Class Method Details



52
53
54
55
56
57
58
# File 'lib/site_logic.rb', line 52

def self.footer_nav
  footer_nav ||= Navigation.new(
    :kind => :primary,
    :label => self.navigation_options[:footer][:label],
    :description => self.navigation_options[:footer][:description]
  )
end


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/site_logic.rb', line 19

def self.navigation_options
  navigation_options ||= {
    :primary => {
      :label => "Primary Navigation",
      :description => "Primary navigation items appear in the main navigation bar on each page."
    },
    :secondary => {
      :label => "Secondary Navigation",
      :description => "Secondary navigation items appear at the top of each page, above the main navigation bar."
    },
    :footer => {
      :label => "Footer Navigation",
      :description => "Footer navigation items appear at the bottom of each page."
    }
  }
end

.primary_navObject



36
37
38
39
40
41
42
# File 'lib/site_logic.rb', line 36

def self.primary_nav
  primary_nav ||= Navigation.new(
    :kind => :primary,
    :label => self.navigation_options[:primary][:label],
    :description => self.navigation_options[:primary][:description]
  )
end

.secondary_navObject



44
45
46
47
48
49
50
# File 'lib/site_logic.rb', line 44

def self.secondary_nav
  secondary_nav ||= Navigation.new(
    :kind => :primary,
    :label => self.navigation_options[:secondary][:label],
    :description => self.navigation_options[:secondary][:description]
  )
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (SiteLogic)

    the object that the method was called on



15
16
17
# File 'lib/site_logic.rb', line 15

def self.setup
  yield self
end