Class: Ivar::Declaration
- Inherits:
-
Object
- Object
- Ivar::Declaration
- Defined in:
- lib/ivar/declaration.rb
Overview
Base class for all declarations
Direct Known Subclasses
Instance Attribute Summary collapse
-
#manifest ⇒ Symbol
readonly
The name of the instance variable.
-
#name ⇒ Symbol
readonly
The name of the instance variable.
Instance Method Summary collapse
-
#before_init(instance, args, kwargs) ⇒ Object
Called before object initialization.
-
#initialize(name, manifest) ⇒ Declaration
constructor
Initialize a new declaration.
-
#on_declare(klass) ⇒ Object
Called when the declaration is added to a class.
Constructor Details
#initialize(name, manifest) ⇒ Declaration
Initialize a new declaration
11 12 13 14 |
# File 'lib/ivar/declaration.rb', line 11 def initialize(name, manifest) @name = name.to_sym @manifest = manifest end |
Instance Attribute Details
#manifest ⇒ Symbol (readonly)
7 8 9 |
# File 'lib/ivar/declaration.rb', line 7 def manifest @manifest end |
#name ⇒ Symbol (readonly)
7 8 9 |
# File 'lib/ivar/declaration.rb', line 7 def name @name end |
Instance Method Details
#before_init(instance, args, kwargs) ⇒ Object
Called before object initialization
26 27 28 |
# File 'lib/ivar/declaration.rb', line 26 def before_init(instance, args, kwargs) # Base implementation does nothing end |
#on_declare(klass) ⇒ Object
Called when the declaration is added to a class
18 19 20 |
# File 'lib/ivar/declaration.rb', line 18 def on_declare(klass) # Base implementation does nothing end |