Class: Jeny::File

Inherits:
Object
  • Object
show all
Defined in:
lib/jeny/file.rb,
lib/jeny/file/full.rb,
lib/jeny/file/with_blocks.rb

Direct Known Subclasses

Full, WithBlocks

Defined Under Namespace

Classes: Full, WithBlocks

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/jeny/file.rb', line 8

def config
  @config
end

#pathObject (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