Class | TMail::AddressGroup
In: | lib/tmail/address.rb
Parent: | Object

### Methods

== [] accept add address_group? delete each each_address empty? eql? flatten hash include? new push size to_a to_ary

### Included Modules

Enumerable StrategyInterface

### Attributes

name | [R] |

### Public Class methods

new( name, addrs )

[Source]

    # File lib/tmail/address.rb, line 301
        def initialize( name, addrs )
          @name = name
          @addresses = addrs
        end

### Public Instance methods

==( other )

[Source]

    # File lib/tmail/address.rb, line 308
        def ==( other )
          other.respond_to? :to_a and @addresses == other.to_a
        end

[]( idx )

[Source]

    # File lib/tmail/address.rb, line 318
        def []( idx )
          @addresses[idx]
        end

accept( strategy, dummy1 = nil, dummy2 = nil )

[Source]

    # File lib/tmail/address.rb, line 372
        def accept( strategy, dummy1 = nil, dummy2 = nil )
          strategy.phrase @name
          strategy.meta ':'
          strategy.space
          first = true
          each do |mbox|
            if first
              first = false
            else
              strategy.puts_meta ','
            end
            strategy.space
            mbox.accept strategy
          end
          strategy.meta ';'
          strategy.lwsp ''
        end

add( a )

[Source]

    # File lib/tmail/address.rb, line 360
        def add( a )
          @addresses.push a
        end

address_group?()

[Source]

    # File lib/tmail/address.rb, line 297
        def address_group?
          true
        end

delete( a )

[Source]

    # File lib/tmail/address.rb, line 366
        def delete( a )
          @addresses.delete a
        end

each( &block )

[Source]

    # File lib/tmail/address.rb, line 330
        def each( &block )
          @addresses.each(&block)
        end

each_address( &block )

[Source]

    # File lib/tmail/address.rb, line 356
        def each_address( &block )
          flatten.each(&block)
        end

empty?()

[Source]

    # File lib/tmail/address.rb, line 326
        def empty?
          @addresses.empty?
        end

eql?( other )

Alias for #==

flatten()

[Source]

    # File lib/tmail/address.rb, line 344
        def flatten
          set = []
          @addresses.each do |a|
            if a.respond_to? :flatten
              set.concat a.flatten
            else
              set.push a
            end
          end
          set
        end

hash()

[Source]

    # File lib/tmail/address.rb, line 314
        def hash
          map {|i| i.hash }.hash
        end

include?( a )

[Source]

    # File lib/tmail/address.rb, line 340
        def include?( a )
          @addresses.include? a
        end

push( a )

Alias for add

size()

[Source]

    # File lib/tmail/address.rb, line 322
        def size
          @addresses.size
        end

to_a()

[Source]

    # File lib/tmail/address.rb, line 334
        def to_a
          @addresses.dup
        end

to_ary()

Alias for to_a

[Validate]