Class: Camping::H

### Home Classes Methods

### In Files

- lib/camping-unabridged.rb

### Parent

Hash

### Methods

- #method_missing

### Files

- CHANGELOG
- COPYING

### Class/Module Index

Quicksearch

- Camping
- Camping::Base
- Camping::Controllers
- Camping::Cookies
- Camping::H
- Camping::Helpers
- Camping::Models
- Camping::Models::Base
- Camping::Reloader
- Camping::Server
- Camping::Server::Options
- Camping::Server::XSendfile
- Camping::Session
- Camping::Views
- Camping::X

No matching classes.

# Camping::H

An object-like Hash. All Camping query string and cookie variables are loaded as this.

To access the query string, for instance, use the `@input` variable.

    module Blog::Controllers
      class Index < R '/'
        def get
          if (page = @input.page.to_i) > 0
            page -= 1
          end
          @posts = Post.all, :offset => page * 20, :limit => 20
          render :index
        end
      end
    end

In the above example if you visit `/?page=2`, you'll get the second page of twenty posts. You can also use `@input['page']` to get the value for the `page` query variable.

### Public Instance Methods

method_missing(m,*a) click to toggle source

Gets or sets keys in the hash.

    @cookies.my_favorite = :macadamian
    @cookies.my_favorite
    => :macadamian

    # File lib/camping-unabridged.rb, line 81
    def method_missing(m,*a)
        m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.