class Gobbler::Project

Projects that you have backed up with Gobbler

Public Class Methods

list(opts = {}) click to toggle source

@return [Array<Project>] an array of Gobbler Projects

# File lib/gobbler/project.rb, line 16
def self.list(opts = {})
  opts[:offset] ||= 0
  ::Gobbler.request("client_project/sync_ask", options: opts)["updates"].map {|project| new(project)}
end

Public Instance Methods

checkpoints() click to toggle source

@return [Array<Checkpoint>] an array of Checkpoints for this project

# File lib/gobbler/project.rb, line 28
def checkpoints
  (1..current_checkpoint["num"]).map do |checkpoint_num|
   ::Gobbler::Checkpoint.get(project_id: guid, checkpoint: checkpoint_num)
  end
end
email_to(recipients, opts = {}) click to toggle source

@return [Hash] The information about the email sent

# File lib/gobbler/project.rb, line 35
def email_to(recipients, opts = {})
  params = {guid: guid, recipients: recipients}
  params[:is_public] = opts[:public] if opts[:public] == true
  params[:checkpoint] = opts[:checkpoint] if opts[:checkpoint]
  ::Gobbler.request("client_mailbox/send_project", params)
end
last_checkpoint() click to toggle source

Get the last checkpoint for a project @return [Checkpoint]

# File lib/gobbler/project.rb, line 23
def last_checkpoint
  ::Gobbler::Checkpoint.get(project_id: guid, checkpoint: current_checkpoint["num"])
end