lib/nanoc/base/source_data/item.rb in nanoc-3.7.3 vs lib/nanoc/base/source_data/item.rb in nanoc-3.7.4
- old
+ new
@@ -24,19 +24,19 @@
#
# @return [String] This item's identifier
attr_accessor :identifier
# @return [Array<Nanoc::ItemRep>] This item’s list of item reps
- attr_reader :reps
+ attr_reader :reps
# @return [String] This item's raw, uncompiled content of this item (only
# available for textual items)
- attr_reader :raw_content
+ attr_reader :raw_content
# @return [String] The filename pointing to the file containing this
# item’s content
- attr_reader :raw_filename
+ attr_reader :raw_filename
# @return [Nanoc::Site] The site this item belongs to
attr_accessor :site
# @return [Nanoc::Item, nil] The parent item of this item. This can be
@@ -173,22 +173,22 @@
# Get captured content (hax)
# TODO [in nanoc 4.0] remove me
if key.to_s =~ /^content_for_(.*)$/
@@_content_for_warning_issued ||= false
- @@_Nanoc_Helpers_Capturing_included ||= false
+ @@_capturing_helper_included ||= false
# Warn
unless @@_content_for_warning_issued
warn 'WARNING: Accessing captured content should happen using the #content_for method defined in the Capturing helper instead of using item[:content_for_something]. The latter way of accessing captured content will be removed in nanoc 4.0.'
@@_content_for_warning_issued = true
end
# Include capturing helper if necessary
- unless @@_Nanoc_Helpers_Capturing_included
+ unless @@_capturing_helper_included
self.class.send(:include, ::Nanoc::Helpers::Capturing)
- @@_Nanoc_Helpers_Capturing_included = true
+ @@_capturing_helper_included = true
end
# Get content
return content_for(self, $1.to_sym)
end
@@ -205,11 +205,11 @@
@attributes[key] = value
end
# @return [Boolean] True if the item is binary; false if it is not
def binary?
- !!@is_binary
+ @is_binary
end
# Returns the type of this object. Will always return `:item`, because
# this is an item. For layouts, this method returns `:layout`.
#
@@ -224,10 +224,10 @@
#
# @api private
#
# @return [Object] An unique reference to this object
def reference
- [ type, identifier ]
+ [type, identifier]
end
# Prevents all further modifications to its attributes.
#
# @return [void]