Sha256: 44fa6011603cf654277e2e2d9272635684b4027e140a20243e8cb9f8c6dbc7a4
Contents?: true
Size: 1.2 KB
Versions: 8
Compression:
Stored size: 1.2 KB
Contents
module Nanoc module Int # @api private class Document # @return [Nanoc::Int::Content] attr_reader :content # @return [Hash] attr_reader :attributes # @return [Nanoc::Identifier] attr_accessor :identifier # @param [String, Nanoc::Int::Content] content # # @param [Hash] attributes # # @param [String, Nanoc::Identifier] identifier def initialize(content, attributes, identifier) @content = Nanoc::Int::Content.create(content) @attributes = attributes.__nanoc_symbolize_keys_recursively @identifier = Nanoc::Identifier.from(identifier) end # @return [void] def freeze super attributes.__nanoc_freeze_recursively content.freeze end # @abstract # # @return Unique reference to this object def reference raise NotImplementedError end def inspect "<#{self.class} identifier=\"#{identifier}\">" end def hash self.class.hash ^ identifier.hash end def ==(other) other.respond_to?(:identifier) && identifier == other.identifier end alias_method :eql?, :== end end end
Version data entries
8 entries across 8 versions & 1 rubygems