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 17 def initialize(filename, contents = nil) self.filename = filename self.name = File.basename(filename).gsub(/\.[^.]+$/, '') self.attributes = SymbolHash.new(false) @original_contents = contents @parsed = false @locale = nil ensure_parsed end
# File lib/yard/code_objects/extra_file_object.rb, line 63 def ==(other) return false unless self.class === other other.filename == filename end
# File lib/yard/code_objects/extra_file_object.rb, line 29 def attributes ensure_parsed @attributes end
# File lib/yard/code_objects/extra_file_object.rb, line 38 def contents ensure_parsed @contents end
# File lib/yard/code_objects/extra_file_object.rb, line 43 def contents=(contents) @original_contents = contents @parsed = false end
# File lib/yard/code_objects/extra_file_object.rb, line 69 def hash; filename.hash end
# File lib/yard/code_objects/extra_file_object.rb, line 56 def inspect "#<yardoc #{type} #{filename} attrs=#{attributes.inspect}>" end
@param [String] locale the locale name to be translated. @return [void] @since 0.8.3
# File lib/yard/code_objects/extra_file_object.rb, line 51 def locale=(locale) @locale = locale @parsed = false end
Generated with the Darkfish Rdoc Generator 2.