Class: RDoc::Markup::Include

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/markup/include.rb

Overview

A file included at generation time. Objects of this class are created by RDoc::RD for an extension-less include.

This implementation in incomplete.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, include_path) ⇒ Include

Creates a new include that will import file from include_path



22
23
24
25
# File 'lib/rdoc/markup/include.rb', line 22

def initialize file, include_path
  @file = file
  @include_path = include_path
end

Instance Attribute Details

#fileObject (readonly)

The filename to be included, without extension



12
13
14
# File 'lib/rdoc/markup/include.rb', line 12

def file
  @file
end

#include_pathObject (readonly)

Directories to search for #file



17
18
19
# File 'lib/rdoc/markup/include.rb', line 17

def include_path
  @include_path
end

Instance Method Details

#==(other) ⇒ Object

:nodoc:



27
28
29
30
# File 'lib/rdoc/markup/include.rb', line 27

def == other # :nodoc:
  self.class === other and
    @file == other.file and @include_path == other.include_path
end

#pretty_print(q) ⇒ Object

:nodoc:



32
33
34
35
36
37
38
39
# File 'lib/rdoc/markup/include.rb', line 32

def pretty_print q # :nodoc:
  q.group 2, '[incl ', ']' do
    q.text file
    q.breakable
    q.text 'from '
    q.pp include_path
  end
end