Sha256: e0a1fbbb71a7262e581423c7ace413d8f0517cce9ae93d3c04da25efe397af2a

Contents?: true

Size: 613 Bytes

Versions: 13

Compression:

Stored size: 613 Bytes

Contents

# -*- encoding: utf-8 -*-

module Webgen

  # Should be mixed into modules/classes that need access to the current website object.
  module WebsiteAccess

    # The methods of this module are available on classes that include WebsiteAccess.
    module ClassMethods

      # See WebsiteAccess.website
      def website
        WebsiteAccess.website
      end

    end

    def self.included(klass) #:nodoc:
      super
      klass.extend(ClassMethods)
    end

    # Return the current website object or +nil+.
    def website
      Thread.current[:webgen_website]
    end
    module_function :website

  end

end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.8.20090507 lib/webgen/websiteaccess.rb
gettalong-webgen-0.5.9.20090620 lib/webgen/websiteaccess.rb
gettalong-webgen-0.5.9.20090626 lib/webgen/websiteaccess.rb
thewoolleyman-webgen-0.5.8.20090419 lib/webgen/websiteaccess.rb
webgen-0.5.17 lib/webgen/websiteaccess.rb
webgen-0.5.15 lib/webgen/websiteaccess.rb
webgen-0.5.14 lib/webgen/websiteaccess.rb
webgen-0.5.13 lib/webgen/websiteaccess.rb
webgen-0.5.12 lib/webgen/websiteaccess.rb
webgen-0.5.11 lib/webgen/websiteaccess.rb
webgen-0.5.10 lib/webgen/websiteaccess.rb
webgen-0.5.9 lib/webgen/websiteaccess.rb
webgen-0.5.8 lib/webgen/websiteaccess.rb