Class: Teapot::Definition
- Inherits:
-
Object
- Object
- Teapot::Definition
- Defined in:
- lib/teapot/definition.rb
Overview
Base class for definitions (target, configuration, or project).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
The context in which the definition was loaded:.
-
#description ⇒ Object
A textual description of the definition, possibly in markdown format:.
-
#name ⇒ Object
readonly
The name of the definition:.
-
#package ⇒ Object
readonly
The package in which the definition was specified:.
Instance Method Summary collapse
-
#freeze ⇒ Object
Make the definition immutable after it has been loaded from a teapot file.
-
#initialize(context, package, name) ⇒ Definition
constructor
Initialize a new definition.
- #inspect ⇒ Object
-
#path ⇒ Object
The path that the definition is relative to:.
- #to_s ⇒ Object
Constructor Details
#initialize(context, package, name) ⇒ Definition
Initialize a new definition.
13 14 15 16 17 18 19 20 |
# File 'lib/teapot/definition.rb', line 13 def initialize(context, package, name) @context = context @package = package @name = name @description = nil end |
Instance Attribute Details
#context ⇒ Object (readonly)
The context in which the definition was loaded:
36 37 38 |
# File 'lib/teapot/definition.rb', line 36 def context @context end |
#description ⇒ Object
A textual description of the definition, possibly in markdown format:
45 46 47 |
# File 'lib/teapot/definition.rb', line 45 def description @description end |
#name ⇒ Object (readonly)
The name of the definition:
42 43 44 |
# File 'lib/teapot/definition.rb', line 42 def name @name end |
#package ⇒ Object (readonly)
The package in which the definition was specified:
39 40 41 |
# File 'lib/teapot/definition.rb', line 39 def package @package end |
Instance Method Details
#freeze ⇒ Object
Make the definition immutable after it has been loaded from a teapot file.
23 24 25 26 27 28 |
# File 'lib/teapot/definition.rb', line 23 def freeze @name.freeze @description.freeze super end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/teapot/definition.rb', line 31 def inspect "\#<#{self.class.name} #{@name}>" end |
#path ⇒ Object
The path that the definition is relative to:
58 59 60 |
# File 'lib/teapot/definition.rb', line 58 def path @package.path end |
#to_s ⇒ Object
63 64 65 |
# File 'lib/teapot/definition.rb', line 63 def to_s "#<#{self.class} #{@name.dump}>" end |