Class: Teapot::Definition
- Inherits:
-
Object
- Object
- Teapot::Definition
- Defined in:
- lib/teapot/definition.rb
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
-
#initialize(context, package, name) ⇒ Definition
constructor
A new instance of Definition.
-
#path ⇒ Object
The path that the definition is relative to:.
- #pretty_print(pp) ⇒ Object
- #to_s ⇒ Object
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
#context ⇒ Object (readonly)
The context in which the definition was loaded:
44 45 46 |
# File 'lib/teapot/definition.rb', line 44 def context @context end |
#description ⇒ Object
A textual description of the definition, possibly in markdown format:
53 54 55 |
# File 'lib/teapot/definition.rb', line 53 def description @description end |
#name ⇒ Object (readonly)
The name of the definition:
50 51 52 |
# File 'lib/teapot/definition.rb', line 50 def name @name end |
#package ⇒ Object (readonly)
The package in which the definition was specified:
47 48 49 |
# File 'lib/teapot/definition.rb', line 47 def package @package end |
Instance Method Details
#freeze ⇒ Object
32 33 34 35 36 37 |
# File 'lib/teapot/definition.rb', line 32 def freeze @name.freeze @description.freeze super end |
#path ⇒ Object
The path that the definition is relative to:
64 65 66 |
# File 'lib/teapot/definition.rb', line 64 def path @package.path end |
#pretty_print(pp) ⇒ Object
39 40 41 |
# File 'lib/teapot/definition.rb', line 39 def pretty_print(pp) pp.text self.inspect end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/teapot/definition.rb', line 68 def to_s "#<#{self.class} #{@name.dump}>" end |