Class Selectable::Tags
In: lib/selectable/tags.rb
Parent: ::Hash

An example of filtering an Array of tagged objects based on a provided Hash of tags or Array of tag values. obj in this case would be an object that includes Taggable.

    class Something
      def [](tags={})
        tags = [tags].flatten unless tags.is_a?(Hash)
        self.select do |obj|
          obj.tags >= tags
        end
      end
    end

Methods

<   <=   <=>   ==   >   >=   inspect   to_s  

Public Instance methods

Comparison between other Hash and Array objects.

e.g.

    a = {:a => 1, :b => 2}
    a > {:a => 1, :b => 2, :c => 3}    # => false
    a > {:a => 1}                      # => true
    a < {:a => 1, :b => 2, :c => 3}    # => true
    a >= [2, 1]                        # => true
    a > [2, 1]                         # => false

[Validate]