Class: Burner::Library::IO::OpenFileBase
- Inherits:
-
JobWithRegister
- Object
- Job
- JobWithRegister
- Burner::Library::IO::OpenFileBase
- Defined in:
- lib/burner/library/io/open_file_base.rb
Overview
Common configuration/code for all IO Job subclasses that open a file.
Constant Summary
Constants inherited from JobWithRegister
Instance Attribute Summary collapse
-
#binary ⇒ Object
readonly
Returns the value of attribute binary.
-
#disk ⇒ Object
readonly
Returns the value of attribute disk.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from JobWithRegister
Attributes inherited from Job
Instance Method Summary collapse
-
#initialize(path:, binary: false, disk: {}, name: '', register: DEFAULT_REGISTER) ⇒ OpenFileBase
constructor
A new instance of OpenFileBase.
Methods inherited from Job
Methods included from Util::Arrayable
Constructor Details
#initialize(path:, binary: false, disk: {}, name: '', register: DEFAULT_REGISTER) ⇒ OpenFileBase
Returns a new instance of OpenFileBase.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/burner/library/io/open_file_base.rb', line 17 def initialize(path:, binary: false, disk: {}, name: '', register: DEFAULT_REGISTER) super(name: name, register: register) raise ArgumentError, 'path is required' if path.to_s.empty? @binary = binary || false @disk = Disks.make(disk) @path = path.to_s freeze end |
Instance Attribute Details
#binary ⇒ Object (readonly)
Returns the value of attribute binary.
15 16 17 |
# File 'lib/burner/library/io/open_file_base.rb', line 15 def binary @binary end |
#disk ⇒ Object (readonly)
Returns the value of attribute disk.
15 16 17 |
# File 'lib/burner/library/io/open_file_base.rb', line 15 def disk @disk end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/burner/library/io/open_file_base.rb', line 15 def path @path end |