Class: Jeny::File
- Inherits:
-
Object
- Object
- Jeny::File
- Defined in:
- lib/jeny/file.rb,
lib/jeny/file/full.rb,
lib/jeny/file/with_blocks.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Full, WithBlocks
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, config) ⇒ File
constructor
A new instance of File.
- #rewrite(data, to) ⇒ Object
Constructor Details
#initialize(path, config) ⇒ File
Returns a new instance of File.
4 5 6 7 |
# File 'lib/jeny/file.rb', line 4 def initialize(path, config) @path = path @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/jeny/file.rb', line 8 def config @config end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/jeny/file.rb', line 8 def path @path end |
Instance Method Details
#rewrite(data, to) ⇒ Object
10 11 12 |
# File 'lib/jeny/file.rb', line 10 def rewrite(data, to) to.write(instantiate(data)) end |