Class: TeamboxAPI::Comment
- Defined in:
- lib/teambox/teambox-api.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
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, = {}) objects = collection["objects"] objects.collect! { |record| instantiate_record(record, ) } end |
Instance Method Details
#create ⇒ Object
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(={}) val=[] attributes.each_pair do |key, value| val << "#{URI.escape key}=#{URI.escape value}" rescue nil end val.join('&') end |