Module: Sitemapper

Defined in:
lib/sitemapper.rb,
lib/sitemapper/map.rb,
lib/sitemapper/helpers.rb,
lib/sitemapper/adapters/rails_adapter.rb

Defined Under Namespace

Modules: Adapters, Helpers Classes: InvalidMap, Map

Class Method Summary collapse

Class Method Details

.map ⇒ Object



19
20
21
# File 'lib/sitemapper.rb', line 19

def self.map
  @map or raise 'Uninitialized Sitemapper.map'
end

.map=(map) ⇒ Object



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

def self.map=(map)
  @map = map
end

.meta_lookup ⇒ Object



41
42
43
44
45
46
47
# File 'lib/sitemapper.rb', line 41

def self.meta_lookup
  @meta_lookup || {
    :desc     => [:short_description, :description],
    :keywords => [:tag_list, :keywords],
    :title    => [:title, :name]
  }
end

.meta_lookup=(lookup) ⇒ Object

Define the default meta lookup for objects on page helper

lookup is a hash with the following options:

  • :desc method to look for page description
  • :keywords method to look for page keywords
  • :title method to look for page title

All these arguments can be an Array, String or Symbol and will be used to lookup a valid method when you call page using something different of a Hash as argument. For example:

<% page(@contact) %>



37
38
39
# File 'lib/sitemapper.rb', line 37

def self.meta_lookup=(lookup)
  @meta_lookup = lookup
end

.version ⇒ Object

Get the running version of Sitemapper



11
12
13
# File 'lib/sitemapper.rb', line 11

def self.version
  [MAJOR, MINOR, TINY].join('.')
end