An ExtraFileObject represents an extra documentation file (README or other file). It is not strictly a CodeObject (does not inherit from `Base`) although it implements `path`, `name` and `type`, and therefore should be structurally compatible with most CodeObject interfaces.
Creates a new extra file object. @param [String] filename the location on disk of the file @param [String] contents the file contents. If not set, the contents
will be read from disk using the +filename+.
# File lib/yard/code_objects/extra_file_object.rb, line 16 def initialize(filename, contents = nil) self.filename = filename self.name = File.basename(filename).gsub(/\.[^.]+$/, '') self.attributes = SymbolHash.new(false) parse_contents(contents || File.read(@filename)) end
# File lib/yard/code_objects/extra_file_object.rb, line 36 def ==(other) return false unless self.class === other other.filename == filename end
# File lib/yard/code_objects/extra_file_object.rb, line 42 def hash; filename.hash end
# File lib/yard/code_objects/extra_file_object.rb, line 29 def inspect "#<yardoc #{type} #{filename} attrs=#{attributes.inspect}>" end
Generated with the Darkfish Rdoc Generator 2.