Class: Coop::Group

Inherits:
APIObject show all
Defined in:
lib/coop/api_object/group.rb

Instance Method Summary collapse

Methods inherited from APIObject

parse_response

Instance Method Details

#agendaObject

Public: The base for all agenda API calls

Examples

self.statuses
# => #<Coop::Agenda @group_id=12345>

Returns a Coop::Agenda instance with the group_id set



52
53
54
# File 'lib/coop/api_object/group.rb', line 52

def agenda
  Agenda.new({ group_id: self.id })
end

#post!(message) ⇒ Object

Public: Post a status update to a group

message - The text for the status update

Examples

Group.new({ id: 12345 }).post! "Is this computer?"
# => "/statuses/123456"

Returns String of new status’ URL



25
26
27
# File 'lib/coop/api_object/group.rb', line 25

def post!(message)
  Status.new({ group_id: self.id }).post!(message)
end

#post_as_cobot!(message, api_key) ⇒ Object

Public: Post a status update to a group as Cobot

message - The text for the status update api_key - The API key needed to post as Cobot

Examples

Group.new({ id: 12345 }).post_as_cobot! "YES, THIS IS COMPUTER", "THISISMYSECRETKEY"
# => "/statuses/123456"

Returns String of new status’ URL



40
41
42
# File 'lib/coop/api_object/group.rb', line 40

def post_as_cobot!(message, api_key)
  Status.new({ group_id: self.id }).post_as_cobot!(message, api_key)
end

#statusesObject

Public: The base for all status API calls

Examples

self.statuses
# => #<Coop::Status @group_id=12345>

Returns a Coop::Status instance with the group_id set



11
12
13
# File 'lib/coop/api_object/group.rb', line 11

def statuses
  Status.new({ group_id: self.id })
end

#usersObject

Public: The base for all user API calls

Examples

self.users
# => #<Coop::User @group_id=12345>

Returns a Coop::User instance with the group_id set



64
65
66
# File 'lib/coop/api_object/group.rb', line 64

def users
  User.new({ group_id: self.id }).all
end