Class: Vedeu::Renderers::File Private

Inherits:
Object
  • Object
show all
Includes:
Options
Defined in:
lib/vedeu/renderers/support/file.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Writes the given output to a file.

Direct Known Subclasses

Escape, HTML, JSON, Text

Instance Attribute Summary

Attributes included from Options

#options

Instance Method Summary collapse

Methods included from Options

#clear, #compression, #compression?, #default_template, #defaults, #end_row_tag, #end_tag, #filename, #initialize, #output, #output?, #render, #start_row_tag, #start_tag, #template, #timestamp, #timestamp?, #write_file

Methods included from Common

#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?

Instance Method Details

#contentString (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


29
30
31
# File 'lib/vedeu/renderers/support/file.rb', line 29

def content
  output
end

#writeString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Render the output (either content or clearing) to a file.

Returns:

  • (String)


18
19
20
21
22
23
24
# File 'lib/vedeu/renderers/support/file.rb', line 18

def write
  data = content

  ::File.write(filename, data)

  data
end

#write_file?Boolean (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



34
35
36
# File 'lib/vedeu/renderers/support/file.rb', line 34

def write_file?
  true
end