Class: Desk::Api::Groups

Inherits:
Object
  • Object
show all
Includes:
Listable
Defined in:
lib/desk/api/groups.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Listable

#all, #show

Constructor Details

#initialize(connection) ⇒ Groups

Returns a new instance of Groups.



14
15
16
17
18
# File 'lib/desk/api/groups.rb', line 14

def initialize(connection)
  @connection = connection
  @endpoint = "groups"
  @return_class = Desk::Group
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



12
13
14
# File 'lib/desk/api/groups.rb', line 12

def connection
  @connection
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



12
13
14
# File 'lib/desk/api/groups.rb', line 12

def endpoint
  @endpoint
end

#return_classObject (readonly)

Returns the value of attribute return_class.



12
13
14
# File 'lib/desk/api/groups.rb', line 12

def return_class
  @return_class
end

Instance Method Details

#filters(id) ⇒ Object



20
21
22
# File 'lib/desk/api/groups.rb', line 20

def filters(id)
  Desk::Collection.new(connection.get("groups/#{id}/filters"), Desk::Filter)
end

#users(id) ⇒ Object



24
25
26
# File 'lib/desk/api/groups.rb', line 24

def users(id)
  Desk::Collection.new(connection.get("groups/#{id}/users"), Desk::User)
end