Class | SOAP::Attachment
In: | soap/attachment.rb
Parent: | Object

### Methods

content contentid contentid contentid= mime_contentid mime_contentid new save to_s write

### Attributes

contenttype | [RW] |
io | [R] |

### Public Class methods

contentid(obj)

[Source]

    # File soap/attachment.rb, line 76
      def self.contentid(obj)
        # this needs to be fixed
        [obj.__id__.to_s, Process.pid.to_s].join('.')
      end

mime_contentid(obj)

[Source]

    # File soap/attachment.rb, line 81
      def self.mime_contentid(obj)
        '<' + contentid(obj) + '>'
      end

new(string_or_readable = nil)

[Source]

    # File soap/attachment.rb, line 36
      def initialize(string_or_readable = nil)
        @string_or_readable = string_or_readable
        @contenttype = "application/octet-stream"
        @contentid = nil
      end

### Public Instance methods

content()

[Source]

    # File soap/attachment.rb, line 54
      def content
        if @content == nil and @string_or_readable != nil
          @content = @string_or_readable.respond_to?(:read) ?
            @string_or_readable.read : @string_or_readable
        end
        @content
      end

contentid()

[Source]

    # File soap/attachment.rb, line 42
      def contentid
        @contentid ||= Attachment.contentid(self)
      end

contentid=(contentid)

[Source]

    # File soap/attachment.rb, line 46
      def contentid=(contentid)
        @contentid = contentid
      end

mime_contentid()

[Source]

    # File soap/attachment.rb, line 50
      def mime_contentid
        '<' + contentid + '>'
      end

save(filename)

[Source]

    # File soap/attachment.rb, line 70
      def save(filename)
        File.open(filename, "wb") do |f|
          write(f)
        end
      end

to_s()

[Source]

    # File soap/attachment.rb, line 62
      def to_s
        content
      end

write(out)

[Source]

    # File soap/attachment.rb, line 66
      def write(out)
        out.write(content)
      end

[Validate]