Class: LexofficeClient::Document

Inherits:
Model::Base show all
Defined in:
lib/lexoffice_client/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model::Base

#attributes=, #initialize

Methods included from Model::Base::SerializationConcern

#as_json, #to_json

Methods included from Model::Base::AttributeNamesConcern

#attributes, included

Constructor Details

This class inherits a constructor from LexofficeClient::Model::Base

Instance Attribute Details

#blobObject

Returns the value of attribute blob.



3
4
5
# File 'lib/lexoffice_client/document.rb', line 3

def blob
  @blob
end

#content_typeObject

Returns the value of attribute content_type.



3
4
5
# File 'lib/lexoffice_client/document.rb', line 3

def content_type
  @content_type
end

#original_filenameObject

Returns the value of attribute original_filename.



3
4
5
# File 'lib/lexoffice_client/document.rb', line 3

def original_filename
  @original_filename
end

Instance Method Details

#to_string_ioObject



5
6
7
8
9
10
11
12
13
# File 'lib/lexoffice_client/document.rb', line 5

def to_string_io
  StringIO.new(blob || "").tap do |string_io|
    string_io.class.class_eval do
      attr_accessor :original_filename, :content_type
    end
    string_io.content_type = content_type
    string_io.original_filename = original_filename
  end
end