Class: Basecamp3::Campfire

Inherits:
Model
  • Object
show all
Includes:
Basecamp3::Concerns::Bucketable, Basecamp3::Concerns::Creatorable
Defined in:
lib/basecamp3/models/campfire.rb

Overview

Constant Summary

REQUIRED_FIELDS =
%w(topic)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Basecamp3::Concerns::Bucketable

#bucket

Methods included from Basecamp3::Concerns::Creatorable

#creator

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Basecamp3::Model

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at



8
9
10
# File 'lib/basecamp3/models/campfire.rb', line 8

def created_at
  @created_at
end

#idObject

Returns the value of attribute id



8
9
10
# File 'lib/basecamp3/models/campfire.rb', line 8

def id
  @id
end

#statusObject

Returns the value of attribute status



8
9
10
# File 'lib/basecamp3/models/campfire.rb', line 8

def status
  @status
end

#topicObject

Returns the value of attribute topic



8
9
10
# File 'lib/basecamp3/models/campfire.rb', line 8

def topic
  @topic
end

#updated_atObject

Returns the value of attribute updated_at



8
9
10
# File 'lib/basecamp3/models/campfire.rb', line 8

def updated_at
  @updated_at
end

Class Method Details

.all(params = {}) ⇒ Array<Basecamp3::Campfire>

Returns a paginated list of all active campfires visible to the current user.

Parameters:

  • params (Hash) (defaults to: {})

    additional parameters

Options Hash (params):

  • :page (Integer) — default: optional

    to paginate results

Returns:



29
30
31
# File 'lib/basecamp3/models/campfire.rb', line 29

def self.all(params = {})
  Basecamp3.request.get("/chats", params, Basecamp3::Campfire)
end

.find(bucket_id, id) ⇒ Basecamp3::Campfire

Returns the campfire.

Parameters:

  • bucket_id (Integer)

    the id of the bucket

  • id (Integer)

    the id of the campfire

Returns:



39
40
41
# File 'lib/basecamp3/models/campfire.rb', line 39

def self.find(bucket_id, id)
  Basecamp3.request.get("/buckets/#{bucket_id}/chats/#{id}", {}, Basecamp3::Campfire)
end

Instance Method Details

#linesArray<Basecamp3::CampfireLine>

Returns a list of related lines.

Returns:



19
20
21
# File 'lib/basecamp3/models/campfire.rb', line 19

def lines
  @mapped_lines ||= Basecamp3::CampfireLine.all(bucket.id, id)
end