Class: FileComposer::Documents::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/file_composer/documents/base.rb

Overview

Parent class for all documents.

Direct Known Subclasses

Text, Zip

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:) ⇒ Base

Returns a new instance of Base.

Raises:

  • (ArgumentError)


21
22
23
24
25
# File 'lib/file_composer/documents/base.rb', line 21

def initialize(filename:)
  raise ArgumentError, 'filename is required' if filename.to_s.empty?

  @filename = filename.to_s
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



19
20
21
# File 'lib/file_composer/documents/base.rb', line 19

def filename
  @filename
end