Class: Gobbler::Project
Overview
Projects that you have backed up with Gobbler
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.list(opts = {}) ⇒ Array<Project>
An array of Gobbler Projects.
Instance Method Summary collapse
-
#checkpoints ⇒ Array<Checkpoint>
An array of Checkpoints for this project.
-
#email_to(recipients, opts = {}) ⇒ Hash
The information about the email sent.
-
#last_checkpoint ⇒ Checkpoint
Get the last checkpoint for a project.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gobbler::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gobbler::Base
Class Method Details
.list(opts = {}) ⇒ Array<Project>
Returns an array of Gobbler Projects.
16 17 18 19 |
# 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 |
Instance Method Details
#checkpoints ⇒ Array<Checkpoint>
Returns an array of Checkpoints for this project.
28 29 30 31 32 |
# 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 = {}) ⇒ Hash
Returns The information about the email sent.
35 36 37 38 39 40 |
# 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 ⇒ Checkpoint
Get the last checkpoint for a project
23 24 25 |
# File 'lib/gobbler/project.rb', line 23 def last_checkpoint ::Gobbler::Checkpoint.get(project_id: guid, checkpoint: current_checkpoint["num"]) end |