Class: Bauk::Gen::Contents::FileContent

Inherits:
BaseContent show all
Defined in:
lib/bauk/gen/contents/file_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ FileContent

Returns a new instance of FileContent.



11
12
13
14
# File 'lib/bauk/gen/contents/file_content.rb', line 11

def initialize(opts)
  super(opts)
  @file = File.new(opts[:file])
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



9
10
11
# File 'lib/bauk/gen/contents/file_content.rb', line 9

def file
  @file
end

Instance Method Details

#contentObject



16
17
18
# File 'lib/bauk/gen/contents/file_content.rb', line 16

def content
  @file.read
end