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
- #attributes_checksum_data ⇒ Object readonly private
- #content_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:, attributes:, content: nil, filename: nil, content_checksum_data: nil, attributes_checksum_data: nil) ⇒ ProtoDocument
constructor
private
A new instance of ProtoDocument.
Constructor Details
#initialize(is_binary:, attributes:, content: nil, filename: nil, content_checksum_data: 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.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 124 def initialize( is_binary:, attributes:, content: nil, filename: nil, content_checksum_data: 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 @content_checksum_data = content_checksum_data @attributes_checksum_data = attributes_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.
118 119 120 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 118 def attributes @attributes end |
#attributes_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.
120 121 122 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 120 def attributes_checksum_data @attributes_checksum_data end |
#content_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.
119 120 121 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 119 def content_checksum_data @content_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.
121 122 123 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 121 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.
141 142 143 144 145 146 147 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 141 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.
149 150 151 152 153 154 155 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 149 def filename if binary? @filename else raise ArgumentError, 'cannot fetch filename of non-binary item' end end |