def create data
      if data.kind_of?(Array)
        # TODO: server should accept multiple items to create,
        # instead of making multiple requests.
        data.map {|item| self.create(item) }
      else
        @client.post @segments, data
      end
    end
def create data
      if data.kind_of?(Array)
        # TODO: server should accept multiple items to create,
        # instead of making multiple requests.
        data.map {|item| self.create(item) }
      else
        @client.post @segments, data
      end
    end
Create an item into the collection

 @param data [Hash, Array] item or array of items
 @return [Hash, Array]