This repository was archived by the owner on Apr 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
83 lines (51 loc) · 1.9 KB
/
README
File metadata and controls
83 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
= Inheritor
* http://rubyworks.github.com/inheritor
* http://github.com/rubyworks/inheritor
== DESCRIPTION
Inheritor provides a means to store and inherit data along the class
heirarchy. An inheritor creates two methods, one named after for the
+key+ that provides a reader, and one named +key!+ which provides
the writer. Because of the unique nature of Inheritor, the reader
cannot be used to modify the underlying store b/c it is a calculated
attribute, thus any modifications to the result would not be passed on
to the descendents.
The most notable feature of Inheritor is that it is dynamic. Unlike other
solutions, such as ActiveSupport's +class_inheritable_accessor+, Inheritor
dynamically generates the inherited value whenever the reader is called,
as opposed to copying the parents variable value upon class creation or
some other specific trigger.
== FEATURES/ISSUES
* Create inheritable attributes.
* Works with modules, providing module method inheritance.
* Easily handles any data and inheritance type.
== RELEASE NOTES
Please see HISTORY file.
== SYNOPSIS
To create an inheritable class variable provide the #inheritor method
with the name of the variable, it's initial value, and the methdod
to be used to process inheritence from descendent to descendent.
class X
inheritor :foo, [], :+
end
class Y < X
end
X.x! << :a
X.x => [:a]
Y.x => [:a]
Y.x! << :b
X.x => [:a]
Y.x => [:a, :b]
== HOW TO INSTALL
To install with RubyGems simply open a console and type:
gem install inheritor
Local installation requires Setup.rb (gem install setup),
then download the tarball package and type:
tar -xvzf inheritor-1.0.0.tgz
cd inheritor-1.0.0
sudo setup.rb all
Windows users use 'ruby setup.rb all'.
== COPYING
(MIT License)
Copyright (c) 2004 Thomas Sawyer
This program is ditributed unser the terms of the MIT license.
See LICENSE or COPYING file for details.