Class: Nanoc::DataSources::Filesystem::ProtoDocument Private
- Inherits:
-
Object
- Object
- Nanoc::DataSources::Filesystem::ProtoDocument
- Defined in:
- lib/nanoc/data_sources/filesystem.rb
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.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly private
- #checksum_data ⇒ Object readonly private
- #is_binary ⇒ Object (also: #binary?) readonly private
Instance Method Summary collapse
- #content ⇒ Object private
- #filename ⇒ Object private
-
#initialize(is_binary:, content: nil, filename: nil, attributes:, checksum_data: nil) ⇒ ProtoDocument
constructor
private
A new instance of ProtoDocument.
Constructor Details
#initialize(is_binary:, content: nil, filename: nil, attributes:, checksum_data: nil) ⇒ ProtoDocument
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 a new instance of ProtoDocument.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 83 def initialize(is_binary:, content: nil, filename: nil, attributes:, checksum_data: nil) if content.nil? && filename.nil? raise ArgumentError, '#initialize needs at least content or filename' end @is_binary = is_binary @content = content @filename = filename @attributes = attributes @checksum_data = checksum_data end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
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.
78 79 80 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 78 def attributes @attributes end |
#checksum_data ⇒ Object (readonly)
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.
79 80 81 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 79 def checksum_data @checksum_data end |
#is_binary ⇒ Object (readonly) Also known as: binary?
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.
80 81 82 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 80 def is_binary @is_binary end |
Instance Method Details
#content ⇒ Object
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.
95 96 97 98 99 100 101 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 95 def content if binary? raise ArgumentError, 'cannot fetch content of binary item' else @content end end |
#filename ⇒ Object
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.
103 104 105 106 107 108 109 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 103 def filename if binary? @filename else raise ArgumentError, 'cannot fetch filename of non-binary item' end end |