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[W]
filename[RW]
locale[R]

@since 0.8.3

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 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

Public Instance Methods

==(other) click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 63
def ==(other)
  return false unless self.class === other
  other.filename == filename
end
Also aliased as: eql?, equal?
attributes() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 29
def attributes
  ensure_parsed
  @attributes
end
contents() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 38
def contents
  ensure_parsed
  @contents
end
contents=(contents) click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 43
def contents=(contents)
  @original_contents = contents
  @parsed = false
end
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 69
def hash; filename.hash end
inspect() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 56
def inspect
  "#<yardoc #{type} #{filename} attrs=#{attributes.inspect}>"
end
Also aliased as: to_s
locale=(locale) click to toggle source

@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
title() click to toggle source
# File lib/yard/code_objects/extra_file_object.rb, line 34
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 61
def type; 'extra_file' end

[Validate]

Generated with the Darkfish Rdoc Generator 2.