class GoogleSpreadsheet::AclEntry

An entry of an ACL (access control list) of a spreadsheet.

Use GoogleSpreadsheet::Acl#[] to get GoogleSpreadsheet::AclEntry object.

This code is based on github.com/guyboertje/gdata-spreadsheet-ruby .

Attributes

edit_url[R]

Edit URL of the entry.

etag[R]

E-tag of the entry.

params[RW]
role[R]

The role given to the scope. One of:

  • “owner”: The owner.

  • “writer”: With read/write access.

  • “reader”: With read-only access.

scope[R]

The scope. See scope_type.

scope_type[R]

Type of the scope. One of:

  • “user”: scope is a user’s email address.

  • “group”: scope is a Google Group email address.

  • “domain”: scope is a Google Apps domain.

  • “default”: Publicly shared with all users. scope is nil.

title[R]

Title of the entry.

Public Class Methods

new(params) click to toggle source

params is a Hash object with keys :scope_type, :scope and :role. See #scope_type and role for the document of the fields.

# File lib/google_spreadsheet/acl_entry.rb, line 24
def initialize(params)
  @params = {:role => "reader"}
  for name, value in params
    if !PARAM_NAMES.include?(name)
      raise(ArgumentError, "Invalid key: %p" % name)
    end
    @params[name] = value
  end
end

Public Instance Methods

inspect() click to toggle source
# File lib/google_spreadsheet/acl_entry.rb, line 50
def inspect
  return "\#<%p scope_type=%p, scope=%p, role=%p>" %
      [self.class, @params[:scope_type], @params[:scope], @params[:role]]
end
role=(role) click to toggle source

Changes the role of the scope.

e.g.

spreadsheet.acl[1].role = "writer"
# File lib/google_spreadsheet/acl_entry.rb, line 46
def role=(role)
  @params[:acl].update_role(self, role)
end