Class: Glassfrog::Circle

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

Overview

Encapsulates GlassFrog Circles.

Constant Summary collapse

PATH =
'/circles'
TYPE =
:circles

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

Returns:

  • (Hash)


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

def links
  @links
end

#nameString

Returns:

  • (String)


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

def name
  @name
end

#short_nameString

Returns:

  • (String)


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

def short_name
  @short_name
end

#strategyString

Returns:

  • (String)


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

def strategy
  @strategy
end

#sub_circlesArray<Glassfrog::Circle]

Returns Array<Glassfrog::Circle].

Returns:



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

def sub_circles
  @sub_circles
end

Class Method Details

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

Sends a GET request for Circle(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 Circles(s).

Returns:



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

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