Skip to content

Commit

Permalink
README tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalcucco committed May 10, 2011
1 parent 8158c3b commit dc15acd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 116 deletions.
File renamed without changes.
116 changes: 0 additions & 116 deletions lib/basecamp.rb
Expand Up @@ -31,122 +31,6 @@
end
end

# = A Ruby library for working with the Basecamp web-services API.
#
# For more information about the Basecamp web-services API, visit:
#
# http://developer.37signals.com/basecamp
#
# NOTE: not all of Basecamp's web-services are accessible via REST. This
# library provides access to RESTful services via ActiveResource. Services not
# yet upgraded to REST are accessed via the Basecamp class. Continue reading
# for more details.
#
#
# == Establishing a Connection
#
# The first thing you need to do is establish a connection to Basecamp. This
# requires your Basecamp site address and your login credentials. Example:
#
# Basecamp.establish_connection!('you.grouphub.com', 'username', 'password')
#
# This is the same whether you're accessing using the ActiveResource interface,
# or the legacy interface.
#
#
# == Using the REST interface via ActiveResource
#
# The REST interface is accessed via ActiveResource, a popular Ruby library
# that implements object-relational mapping for REST web-services. For more
# information on working with ActiveResource, see:
#
# * http://api.rubyonrails.org/files/activeresource/README.html
# * http://api.rubyonrails.org/classes/ActiveResource/Base.html
#
#
# === Finding a Resource
#
# Find a specific resource using the +find+ method. Attributes of the resource
# are available as instance methods on the resulting object. For example, to
# find a message with the ID of 8675309 and access its title attribute, you
# would do the following:
#
# m = Basecamp::Message.find(8675309)
# m.title # => 'Jenny'
#
# To find all messages for a given project, use find(:all), passing the
# project_id as a parameter to find. Example:
#
# messages = Basecamp::Message.find(:all, params => { :project_id => 1037 })
# messages.size # => 25
#
#
# === Creating a Resource
#
# Create a resource by making a new instance of that resource, setting its
# attributes, and saving it. If the resource requires a prefix to identify
# it (as is the case with resources that belong to a sub-resource, such as a
# project), it should be specified when instantiating the object. Examples:
#
# m = Basecamp::Message.new(:project_id => 1037)
# m.category_id = 7301
# m.title = 'Message in a bottle'
# m.body = 'Another lonely day, with no one here but me'
# m.save # => true
#
# c = Basecamp::Comment.new(:post_id => 25874)
# c.body = 'Did you get those TPS reports?'
# c.save # => true
#
# You can also create a resource using the +create+ method, which will create
# and save it in one step. Example:
#
# Basecamp::TodoItem.create(:todo_list_id => 3422, :contents => 'Do it')
#
#
# === Updating a Resource
#
# To update a resource, first find it by its id, change its attributes, and
# save it. Example:
#
# m = Basecamp::Message.find(8675309)
# m.body = 'Changed'
# m.save # => true
#
#
# === Deleting a Resource
#
# To delete a resource, use the +delete+ method with the ID of the resource
# you want to delete. Example:
#
# Basecamp::Message.delete(1037)
#
#
# === Attaching Files to a Resource
#
# If the resource accepts file attachments, the +attachments+ parameter should
# be an array of Basecamp::Attachment objects. Example:
#
# a1 = Basecamp::Attachment.create('primary', File.read('primary.doc'))
# a2 = Basecamp::Attachment.create('another', File.read('another.doc'))
#
# m = Basecamp::Message.new(:project_id => 1037)
# ...
# m.attachments = [a1, a2]
# m.save # => true
#
#
# = Using the non-REST inteface
#
# The non-REST interface is accessed via instance methods on the Basecamp
# class. Ensure you've established a connection, then create a new Basecamp
# instance and call methods on it. Object attributes are accessible as methods.
# Example:
#
# session = Basecamp.new
# person = session.person(93832) # => #<Record(person)..>
# person.first_name # => "Jason"
#
module Basecamp
class Connection #:nodoc:
def initialize(master)
Expand Down

0 comments on commit dc15acd

Please sign in to comment.