Class: Bauk::Gen::Contents::FileContent
- Inherits:
-
BaseContent
- Object
- BaseContent
- Bauk::Gen::Contents::FileContent
- Defined in:
- lib/bauk/gen/contents/file_content.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(opts) ⇒ FileContent
constructor
A new instance of FileContent.
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
#file ⇒ Object (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
#content ⇒ Object
16 17 18 |
# File 'lib/bauk/gen/contents/file_content.rb', line 16 def content @file.read end |