lib/totter/client/choices.rb in totter-0.4.7 vs lib/totter/client/choices.rb in totter-0.4.8

- old
+ new

@@ -74,12 +74,29 @@ # @param user_id [Numeric] The choice's decision's user id # @param decision_id [Numeric] The choice's decision's id # @param choice_id [Numeric] The choice's id # @return [Boolean] True if follow was successful, false otherwise. # @example - # Totter.destroy_choice(1, 1) + # Totter.destroy_choice(1, 1, 1) def destroy_choice(user_id, decision_id, choice_id) boolean_from_response(:delete, "users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}") + end + + # Crop a choice + # + # @param user_id [Numeric] The choice's decision's user id + # @param decision_id [Numeric] The choice's decision's id + # @param choice_id [Numeric] The choice's id + # @param x [Numeric] The x position of the start point + # @param y [Numeric] the y position of the start point + # @param width [Numeric] The crop width + # @param height [Numeric] The crop height + # @return [Boolean] True if follow was successful, false otherwise. + # @example + # Totter.crop_choice(1, 1, 1, 0, 0, 300, 300) + def crop_choice(user_id, decision_id, choice_id, x, y, width, height) + data = { x: x, y: y, height: height, width: width } + boolean_from_response(:post, "users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}/crop", data) end end end end