Parent

Class/Module Index [+]

Quicksearch

YARD::CodeObjects::ExtraFileObject

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.

Attributes

attributes[RW]
contents[RW]
filename[RW]
name[RW]
path[RW]

Public Class Methods

new(filename, contents = nil) click to toggle source

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

Public Instance Methods

==(other) click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 36
def ==(other)
  return false unless self.class === other
  other.filename == filename
end
Also aliased as: eql?, equal?
eql?(other) click to toggle source
Alias for: ==
equal?(other) click to toggle source
Alias for: ==
hash() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 42
def hash; filename.hash end
inspect() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 29
def inspect
  "#<yardoc #{type} #{filename} attrs=#{attributes.inspect}>"
end
Also aliased as: to_s
title() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 25
def title
  attributes[:title] || name
end
to_s() click to toggle source
Alias for: inspect
type() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 34
def type; 'extra_file' end

[Validate]

Generated with the Darkfish Rdoc Generator 2.