class GoogleSpreadsheet::Table

DEPRECATED: Table and Record feeds are deprecated and they will not be available after March 2012.

Use GoogleSpreadsheet::Worksheet#add_table to create table. Use GoogleSpreadsheet::Worksheet#tables to get GoogleSpreadsheet::Table objects.

Attributes

worksheet_title[R]

Title of the worksheet the table belongs to.

Public Instance Methods

add_record(values) click to toggle source

Adds a record.

# File lib/google_spreadsheet/table.rb, line 32
        def add_record(values)
          fields = ""
          values.each() do |name, value|
            fields += "<gs:field name='#{h(name)}'>#{h(value)}</gs:field>"
          end
          xml ="            <entry
                xmlns="http://www.w3.org/2005/Atom"
                xmlns:gs="http://schemas.google.com/spreadsheets/2006">
              #{fields}
            </entry>
"
          @session.request(:post, @records_url, :data => xml)
        end
delete() click to toggle source

Deletes this table. Deletion takes effect right away without calling save().

# File lib/google_spreadsheet/table.rb, line 54
def delete
  @session.request(:delete, @edit_url, :header => {"If-Match" => "*"})
end
records() click to toggle source

Returns records in the table.

# File lib/google_spreadsheet/table.rb, line 48
def records
  doc = @session.request(:get, @records_url)
  return doc.css("entry").map(){ |e| Record.new(@session, e) }
end