Class: Gobbler::Checkpoint

Inherits:
Base
  • Object
show all
Defined in:
lib/gobbler/checkpoint.rb

Instance Attribute Summary

Attributes inherited from Base

#json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

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

.get(opts) ⇒ Checkpoint

Gets the checkpoint for a project

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • :project_id (String)

    The id of the project to get

  • :checkpoint (Integer)

    The number of the checkpoint

Returns:



9
10
11
12
# File 'lib/gobbler/checkpoint.rb', line 9

def self.get(opts)
  raise unless opts[:project_id] && opts[:checkpoint]
  new(::Gobbler.request("v1/projects/#{opts[:project_id]}/checkpoints/#{opts[:checkpoint]}"))
end

Instance Method Details

#email_to(recipients, opts = {}) ⇒ Hash

Email this version of the project to a list of recipieints

Parameters:

  • recipieints (String)

    A comma-separated list of email addresses

Returns:

  • (Hash)

    The sevrer response



22
23
24
25
# File 'lib/gobbler/checkpoint.rb', line 22

def email_to(recipients, opts = {})
  opts[:checkpoint] = num
  project.email_to(recipients, opts)
end

#projectProject

Returns The Project that this is a checkpoint for.

Returns:



15
16
17
# File 'lib/gobbler/checkpoint.rb', line 15

def project
  ::Gobbler::Project.get(json["project"])
end