lib/totter/client/decisions.rb in totter-0.2.14 vs lib/totter/client/decisions.rb in totter-0.3.0

- old
+ new

@@ -8,21 +8,21 @@ # @param decision_id [Numeric] The decision's id # @return [Hashie::Mash] # @example # Totter.decision(1, 1) def decision(user_id, decision_id) - get "users/#{user_id}/decisions/#{decision_id}" + get("users/#{user_id}/decisions/#{decision_id}").body end # Create a decision # # @param user_id [Numeric] A Seesaw user id # @return [Hashie::Mash] # @example # Totter.create_decision(1) def create_decision(user_id) - post "users/#{user_id}/decisions" + post("users/#{user_id}/decisions").body end # Publish a decision # # @param user_id [Numeric] The decision's user id @@ -38,54 +38,54 @@ def publish_decision(user_id, decision_id, options = {}) decision_options = { decision: options } - post "users/#{user_id}/decisions/#{decision_id}/publish", decision_options + post("users/#{user_id}/decisions/#{decision_id}/publish", decision_options).body end # Destroy a decision # # @param user_id [Numeric] The decision's user id # @param decision_id [Numeric] The decision's id # @return [Boolean] True if follow was successful, false otherwise. # @example # Totter.destroy_decision(1, 1) def destroy_decision(user_id, decision_id) - boolean_from_response :delete, "users/#{user_id}/decisions/#{decision_id}" + boolean_from_response(:delete, "users/#{user_id}/decisions/#{decision_id}") end # Get decision analytics # # @param user_id [Numeric] The decision's user id # @param decision_id [Numeric] The decision's id # @return [Hashie::Mash] # @example # Totter.decision_analytics(1, 1) def decision_analytics(user_id, decision_id) - get "users/#{user_id}/decisions/#{decision_id}/analytics" + get("users/#{user_id}/decisions/#{decision_id}/analytics").body end # Flag a decision for content review # # @param user_id [Numeric] The decision's user id # @param decision_id [Numeric] The decision's id # @return [Boolean] True if follow was successful, false otherwise. # @example # Totter.flag_decision(1, 1) def flag_decision(user_id, decision_id) - boolean_from_response :post, "users/#{user_id}/decisions/#{decision_id}/flag" + boolean_from_response(:post, "users/#{user_id}/decisions/#{decision_id}/flag") end # Unflag a decision for content review # # @param user_id [Numeric] The decision's user id # @param decision_id [Numeric] The decision's id # @return [Boolean] True if follow was successful, false otherwise. # @example # Totter.unflag_decision(1, 1) def unflag_decision(user_id, decision_id) - boolean_from_response :post, "users/#{user_id}/decisions/#{decision_id}/unflag" + boolean_from_response(:post, "users/#{user_id}/decisions/#{decision_id}/unflag") end end end end