lib/ruby-bbcode.rb
def determine_applicable_tags(additional_tags, method, *tags)
      use_tags = @@tags.merge(additional_tags)
      if method == :disable
        # if method is set to :disable blacklist (remove) the supplied tags
        tags.each { |t| use_tags.delete(t) }
      else
        # only use the supplied tags (whitelist) if method is not :disable
        new_use_tags = {}
        tags.each { |t| new_use_tags[t] = use_tags[t] if use_tags.key?(t) }
        use_tags = new_use_tags
      end
      use_tags
    end
# This method provides the final set of bbcode tags, it merges the default tags with the given additional_tags
# and blacklists(method = :disable) or whitelists the list of tags with the given tags parameter.
This method provides the final set of bbcode tags, it merges the default tags with the given additional_tags
and blacklists(method = :disable) or whitelists the list of tags with the given tags parameter.
This method provides the final set of bbcode tags it merges the default tags with the given additional_tags and blacklists ( method = : disable ) or whitelists the list of tags with the given tags parameter .
def determine_applicable_tags(additional_tags, method, *tags)
      use_tags = @@tags.merge(additional_tags)
      if method == :disable
        tags.each { |t| use_tags.delete(t) }
      else
        new_use_tags = {}
        tags.each { |t| new_use_tags[t] = use_tags[t] if use_tags.key?(t) }
        use_tags = new_use_tags
      end
      use_tags
    end
def determine_applicable_tags ( additional_tags , method , * tags ) use_tags = @@tags . merge ( additional_tags ) if method == :disable tags . each { | t | use_tags . delete ( t ) } else new_use_tags = { } tags . each { | t | new_use_tags [ t ] = use_tags [ t ] if use_tags . key? ( t ) } use_tags = new_use_tags end use_tags end
This method provides the final set of bbcode tags, it merges the default tags with the given additional_tags
and blacklists(method = :disable) or whitelists the list of tags with the given tags parameter.
This method provides the final set of bbcode tags it merges the default tags with the given additional_tags and blacklists ( method = : disable ) or whitelists the list of tags with the given tags parameter .
# if method is set to :disable blacklist (remove) the supplied tags # only use the supplied tags (whitelist) if method is not :disable
additional_tags
method
tags