Class EtherpadLite::Pad
In: lib/etherpad-lite/models/pad.rb
Parent: Object

An Etherpad Lite Pad

This class allows you to interact with pads stored in an Etherpad Lite server. The README has some basic examples.

Note that some functions are restricted to Group pads.

Methods

Attributes

id  [R]  The pad id
instance  [R]  The EtherpadLite::Instance object
rev  [R]  An optional pad revision number

Public Class methods

Creates and returns a new Pad.

Options:

text => ‘initial Pad text

groupID => group id of Group new Pad should belong to

Remove the group id portion of a Group Pad‘s id

Instantiate a Pad. It is presumed to already exist (via Pad.create).

Options:

groupID => a group id

group => an EtherpadLite::Group object

rev => a pad revision number

Public Instance methods

Returns an array of ids of authors who‘ve edited this pad

Returns an array of Authors who‘ve edited this pad

Returns the changeset for the given revision

Returns the number of chat messages

Deletes the Pad

Returns a Diff. If end_rev is not specified, the latest revision will be used

Returns this Pad‘s group, if any

Returns the group_id of this Pad, if any

Returns the Pad‘s text as HTML. Unless you specified a :rev when instantiating the Pad, or specify one here, this will return the latest revision.

Options:

rev => revision_number

Writes HTML to the Pad. There is no ‘save’ method; it is written immediately.

Returns the time the pad was last edited as a Unix timestamp

Sends a custom message of type msg to the pad.

Returns the name of the Pad. For a normal pad, this is the same as it‘s id. But for a Group Pad, this strips away the group id part of the pad id.

Sets the Pad‘s password. This only applies to Pads belonging to a Group.

Returns true if this Pad has a password, false if not. This only applies to Pads belonging to a Group.

Set the pad‘s private status to true or false (opposite of public=) This only applies to Pads belonging to a Group.

Returns true if this is a private Pad (opposite of public?) This only applies to Pads belonging to a Group.

Set the pad‘s public status to true or false (opposite of private=) This only applies to Pads belonging to a Group.

Returns true if this is a public Pad (opposite of private?). This only applies to Pads belonging to a Group.

Returns the Pad‘s read-only id. This is cached.

Returns an Array of all this Pad‘s revision numbers

Returns an array of Pad objects, each with an increasing revision of the text.

Returns the Pad‘s text. Unless you specified a :rev when instantiating the Pad, or specify one here, this will return the latest revision.

Options:

rev => revision_number

Writes txt to the Pad. There is no ‘save’ method; it is written immediately.

Returns the number of users currently editing a pad

Returns an array of users hashes, representing users currently using the pad

users_count()

Alias for user_count

[Validate]