Class: Camper::Client

Inherits:
Object show all
Extended by:
Forwardable
Includes:
Authorization, CommentsAPI, MessageBoardsAPI, MessageTypesAPI, MessagesAPI, PeopleAPI, ProjectsAPI, RecordingsAPI, ResourceAPI, TodolistsAPI, TodosAPI, Logging
Defined in:
lib/camper/client.rb,
lib/camper/api/todos.rb,
lib/camper/api/people.rb,
lib/camper/api/comments.rb,
lib/camper/api/messages.rb,
lib/camper/api/projects.rb,
lib/camper/api/resource.rb,
lib/camper/api/todolists.rb,
lib/camper/api/recordings.rb,
lib/camper/api/message_board.rb,
lib/camper/api/message_types.rb

Overview

Wrapper for the Camper REST API.

Defined Under Namespace

Modules: CommentsAPI, MessageBoardsAPI, MessageTypesAPI, MessagesAPI, PeopleAPI, ProjectsAPI, RecordingsAPI, ResourceAPI, TodolistsAPI, TodosAPI

Constant Summary

Constants included from TodosAPI

TodosAPI::PARAMETERS

Instance Attribute Summary

Attributes included from Logging

#logger

Instance Method Summary collapse

Methods included from TodosAPI

#complete_todo, #create_todo, #reposition_todo, #todo, #todos, #trash_todo, #uncomplete_todo, #update_todo

Methods included from TodolistsAPI

#create_todolist, #todolist, #todolists, #trash_todolist, #update_todolist

Methods included from ResourceAPI

#resource

Methods included from RecordingsAPI

#archive_recording, #recordings, #trash_recording, #unarchive_recording

Methods included from ProjectsAPI

#create_project, #delete_project, #project, #projects, #todoset, #update_project

Methods included from PeopleAPI

#people, #people_in_project, #person, #pingable_people, #profile, #update_access_in_project

Methods included from MessagesAPI

#create_message, #message, #messages, #trash_message, #update_message

Methods included from MessageTypesAPI

#create_message_type, #delete_message_type, #message_type, #message_types, #update_message_type

Methods included from MessageBoardsAPI

#message_board

Methods included from CommentsAPI

#comment, #comments, #create_comment, #trash_comment, #update_comment

Methods included from Authorization

#authorization_uri, #authorize!, #authz_client, #update_access_token!

Constructor Details

#initialize(options = {}) ⇒ Client

Creates a new Client instance.

Raises:

  • (Error:MissingCredentials)


29
30
31
# File 'lib/camper/client.rb', line 29

def initialize(options = {})
  @config = Configuration.new(options)
end

Instance Method Details

#configure {|@config| ... } ⇒ Camper::Client

Allows setting configuration values for this client by yielding the config object to the block

Yields:

  • (@config)

Returns:



48
49
50
51
52
# File 'lib/camper/client.rb', line 48

def configure
  yield @config if block_given?

  self
end

#inspectString

Text representation of the client, masking private token.

Returns:



57
58
59
60
61
# File 'lib/camper/client.rb', line 57

def inspect
  inspected = super
  inspected.sub! @config.access_token, only_show_last_four_chars(@config.access_token) if @config.access_token
  inspected
end