Module: Cashboard::Behaviors::Toggleable
Overview
Standard interface to toggle the status of something between Active and Closed inside Cashboard.
Instance Method Summary collapse
-
#toggle_status ⇒ Object
Toggles status of the project between active/closed and sets appropriate variable.
Instance Method Details
#toggle_status ⇒ Object
Toggles status of the project between active/closed and sets appropriate variable.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cashboard/behaviors/toggleable.rb', line 6 def toggle_status = self.class.() .merge!({:body => self.to_xml}) response = self.class.put(self.links[:toggle_status], ) begin self.class.check_status_code(response) rescue return false end self.is_active = !self.is_active return true end |