Class: Glassfrog::Trigger

Inherits:
Base
  • Object
show all
Defined in:
lib/glassfrog/trigger.rb

Overview

Encapsulates GlassFrog Actions.

Constant Summary collapse

PATH =
'/triggers'
TYPE =
:triggers

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Class Method Summary collapse

Methods inherited from Base

#==, #hashify, #initialize

Methods included from Utils

#extract_id, #parameterize, #symbolize_keys

Constructor Details

This class inherits a constructor from Glassfrog::Base

Instance Attribute Details

#created_atString

Returns:

  • (String)


10
11
12
# File 'lib/glassfrog/trigger.rb', line 10

def created_at
  @created_at
end

#descriptionString

Returns:

  • (String)


10
11
12
# File 'lib/glassfrog/trigger.rb', line 10

def description
  @description
end

Returns:

  • (Hash)


14
15
16
# File 'lib/glassfrog/trigger.rb', line 14

def links
  @links
end

#private_to_circleBoolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/glassfrog/trigger.rb', line 12

def private_to_circle
  @private_to_circle
end

Class Method Details

.get(client, options) ⇒ Array<Glassfrog::Trigger>

Sends a GET request for Trigger(s) to GlassFrog.

Parameters:

  • client (Glassfrog::Client)

    The client that will send the request. Contains the API key.

  • options (Hash, Glassfrog::Base)

    The options used to find the correct Triggers(s).

Returns:



24
25
26
27
# File 'lib/glassfrog/trigger.rb', line 24

def self.get(client, options)
  response = Glassfrog::REST::Get.irregular_get(client, TYPE, PATH, options)
  response[TYPE] ? response[TYPE].map { |object| self.new(object) } : []
end