lib/petit/shortcode.rb
# Validates and saves a new object to the database.
# To update exisiting objects use {#update}.
#
# @return [Boolean] TRUE if save is successful
# @raise [Petit::ShortcodeAccessError] when access is denied
# @raise [Petit::IncompleteObjectError] when the Shortcode fails validation
Validates and saves a new object to the database.
To update exisiting objects use {#update}.
Validates and saves a new object to the database . To update exisiting objects use { #update } .
def save
      save_time = DATABASE.save(self)
      if save_time
        @created_at = save_time
        @updated_at = save_time
        @access_count = 0
        return true
      end
    end
def save save_time = DATABASE . save ( self ) if save_time @created_at = save_time @updated_at = save_time @access_count = 0 return true end end
Validates and saves a new object to the database.
Validates and saves a new object to the database .
TRUE if save is successful
TRUE if save is successful
Boolean
[Petit::ShortcodeAccessError] when access is denied
[ Petit :: ShortcodeAccessError ] when access is denied
[Petit::IncompleteObjectError] when the Shortcode fails validation
[ Petit :: IncompleteObjectError ] when the Shortcode fails validation