Class: Rake::Pipeline::Web::Filters::MemoryFileWrapper
- Inherits:
-
Struct
- Object
- Struct
- Rake::Pipeline::Web::Filters::MemoryFileWrapper
- Defined in:
- lib/rake-pipeline-web-filters/chained_filter.rb
Overview
Implement the FileWrapper API. Because filters are defined in terms of the FileWrapper API, we can implement an alternative that doesn’t write to disk but still utilizes the same filter definitions.
Instance Attribute Summary collapse
-
#body ⇒ Object
(also: #read)
Returns the value of attribute body.
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#path ⇒ Object
Returns the value of attribute path.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object Also known as: read
Returns the value of attribute body
6 7 8 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 6 def body @body end |
#encoding ⇒ Object
Returns the value of attribute encoding
6 7 8 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 6 def encoding @encoding end |
#path ⇒ Object
Returns the value of attribute path
6 7 8 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 6 def path @path end |
#root ⇒ Object
Returns the value of attribute root
6 7 8 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 6 def root @root end |
Instance Method Details
#create ⇒ Object
15 16 17 18 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 15 def create self.body = "" yield end |
#fullpath ⇒ Object
11 12 13 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 11 def fullpath File.join(root, path) end |
#with_encoding(new_encoding) ⇒ Object
7 8 9 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 7 def with_encoding(new_encoding) self.class.new(root, path, new_encoding, body) end |
#write(contents) ⇒ Object
22 23 24 |
# File 'lib/rake-pipeline-web-filters/chained_filter.rb', line 22 def write(contents) self.body << contents end |