class Teapot::Definition

Attributes

context[R]

The context in which the definition was loaded:

description[R]

A textual description of the definition, possibly in markdown format:

name[R]

The name of the definition:

package[R]

The package in which the definition was specified:

Public Class Methods

new(context, package, name) click to toggle source
# File lib/teapot/definition.rb, line 23
def initialize(context, package, name)
        @context = context
        @package = package
        
        @name = name
        
        @description = nil
end

Public Instance Methods

description=(text) click to toggle source
# File lib/teapot/definition.rb, line 55
def description=(text)
        if text =~ /^(\t+)/
                text = text.gsub(/#{$1}/, '')
        end
        
        @description = text
end
freeze() click to toggle source
Calls superclass method
# File lib/teapot/definition.rb, line 32
def freeze
        @name.freeze
        @description.freeze
        
        super
end
path() click to toggle source

The path that the definition is relative to:

# File lib/teapot/definition.rb, line 64
def path
        @package.path
end
pretty_print(pp) click to toggle source
# File lib/teapot/definition.rb, line 39
def pretty_print(pp)
        pp.text self.inspect
end
to_s() click to toggle source
# File lib/teapot/definition.rb, line 68
def to_s
        "#<#{self.class} #{@name.dump}>"
end