lib/sitemap.rb in sitemap-0.1b vs lib/sitemap.rb in sitemap-0.1b2
- old
+ new
@@ -44,35 +44,35 @@
# Sets the urls to be indexed.
#
# The +host+, or any other global option can be set here:
#
- # Sitemap.instance.render :host => "mywebsite.com" do
+ # Sitemap::Generator.instance.load :host => "mywebsite.com" do
# ...
# end
#
# Simple paths can be added as follows:
#
- # Sitemap.instance.render :host => "mywebsite.com" do
+ # Sitemap::Generator.instance.load :host => "mywebsite.com" do
# path :faq
# end
#
# Object collections are supported too:
#
- # Sitemap.instance.render :host => "mywebsite.com" do
+ # Sitemap::Generator.instance.load :host => "mywebsite.com" do
# resources :activities
# end
#
# Search options such as frequency and priority can be declared as an options hash:
#
- # Sitemap.instance.render :host => "mywebsite.com" do
+ # Sitemap::Generator.instance.load :host => "mywebsite.com" do
# path :root, :priority => 1
# path :faq, :priority => 0.8, :change_frequency => "daily"
# resources :activities, :change_frequency => "weekly"
# end
#
- def render(options = {}, &block)
+ def load(options = {}, &block)
options.each do |k, v|
self.send("#{k}=", v)
end
self.routes = block
end
@@ -158,10 +158,10 @@
end
private
def get_data(object, data)
- data.respond_to?(:call) ? data.call(object) : data
+ data.is_a?(Proc) ? data.call(object) : data
end
end
end