lib/socialization/actors/sharer.rb
def toggle_share!(shareable, opts = {})
        raise Socialization::ArgumentError, "#{shareable} is not shareable!" unless shareable.respond_to?(:is_shareable?) && shareable.is_shareable?
        if shares?(shareable)
          unshare!(shareable)
          false
        else
          share!(shareable, opts)
          true
        end
      end
# Toggles a {Share share} relationship.
#
# @param [Shareable] shareable the object to share/unshare.
# @return [Boolean]
Toggles a {Share share} relationship.
Toggles a { Share share } relationship .
def toggle_share!(shareable, opts = {})
        raise Socialization::ArgumentError, "#{shareable} is not shareable!" unless shareable.respond_to?(:is_shareable?) && shareable.is_shareable?
        if shares?(shareable)
          unshare!(shareable)
          false
        else
          share!(shareable, opts)
          true
        end
      end
def toggle_share! ( shareable , opts = { } ) raise Socialization :: ArgumentError , "#{shareable} is not shareable!" unless shareable . respond_to? ( :is_shareable? ) && shareable . is_shareable? if shares? ( shareable ) unshare! ( shareable ) false else share! ( shareable , opts ) true end end
Toggles a {Share share} relationship.
Toggles a { Share share } relationship .
None
Boolean
shareable
opts
shareable the object to share/unshare.
shareable the object to share / unshare .