Class: Teapot::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/teapot/definition.rb

Direct Known Subclasses

Configuration, Generator, Project, Target

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, package, name) ⇒ Definition

Returns a new instance of Definition.



23
24
25
26
27
28
29
30
# File 'lib/teapot/definition.rb', line 23

def initialize(context, package, name)
	@context = context
	@package = package
	
	@name = name
	
	@description = nil
end

Instance Attribute Details

#contextObject (readonly)

The context in which the definition was loaded:



33
34
35
# File 'lib/teapot/definition.rb', line 33

def context
  @context
end

#descriptionObject

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



42
43
44
# File 'lib/teapot/definition.rb', line 42

def description
  @description
end

#nameObject (readonly)

The name of the definition:



39
40
41
# File 'lib/teapot/definition.rb', line 39

def name
  @name
end

#packageObject (readonly)

The package in which the definition was specified:



36
37
38
# File 'lib/teapot/definition.rb', line 36

def package
  @package
end

Instance Method Details

#pathObject

The path that the definition is relative to:



53
54
55
# File 'lib/teapot/definition.rb', line 53

def path
	@package.path
end

#to_sObject



57
58
59
# File 'lib/teapot/definition.rb', line 57

def to_s
	"<#{self.class.name} #{@name.dump}>"
end