Module HasMachineTags::Console::InstanceMethods

  1. lib/has_machine_tags/console.rb

Public instance methods

tag_add_and_remove (remove_list, add_list)

Removes first list, adds second list and saves changes.

[show source]
# File lib/has_machine_tags/console.rb, line 6
      def tag_add_and_remove(remove_list, add_list)
        self.class.transaction do
          tag_add_and_save(add_list)
          tag_remove_and_save(remove_list)
        end
      end
tag_add_and_save (add_list)

Adds given list and saves.

[show source]
# File lib/has_machine_tags/console.rb, line 14
      def tag_add_and_save(add_list)
        self.tag_list = self.tag_list + current_tag_list(add_list)
        self.save
        self.tag_list
      end
tag_and_save (tag_list)

Resets tag_list to given tag_list and saves.

[show source]
# File lib/has_machine_tags/console.rb, line 28
      def tag_and_save(tag_list)
        self.tag_list = tag_list
        self.save
        self.tag_list
      end
tag_remove_and_save (remove_list)

Removes given list and saves.

[show source]
# File lib/has_machine_tags/console.rb, line 21
      def tag_remove_and_save(remove_list)
        self.tag_list = self.tag_list - current_tag_list(remove_list)
        self.save
        self.tag_list
      end