Class: TeamboxAPI::Comment

Inherits:
Base
  • Object
show all
Defined in:
lib/teambox/teambox-api.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited

Class Method Details

.instantiate_collection(collection, prefix_options = {}) ⇒ Object



241
242
243
244
# File 'lib/teambox/teambox-api.rb', line 241

def self.instantiate_collection(collection, prefix_options = {})
  objects = collection["objects"]
  objects.collect! { |record| instantiate_record(record, prefix_options) }
end

Instance Method Details

#createObject



246
247
248
249
250
# File 'lib/teambox/teambox-api.rb', line 246

def create
  connection.post(collection_path + '?' + encode, nil, self.class.headers).tap do |response|
    load_attributes_from_response(response)
  end
end

#encode(options = {}) ⇒ Object



252
253
254
255
256
257
258
# File 'lib/teambox/teambox-api.rb', line 252

def encode(options={})
  val=[]
  attributes.each_pair do |key, value|
    val << "#{URI.escape key}=#{URI.escape value}" rescue nil
  end
  val.join('&')
end