aetherical_utils 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/lib/aetherical_utils/attribute.rb +17 -18
- data/lib/aetherical_utils/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
@@ -24,28 +24,27 @@ module AethericalUtils
|
|
24
24
|
# ('billable?') as opposed to the instance variable name
|
25
25
|
# ('@billable').
|
26
26
|
|
27
|
-
def self.attribute(*arg,&block)
|
28
|
-
(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
if block_given?
|
35
|
-
instance_eval &block
|
27
|
+
# def self.attribute(*arg,&block)
|
28
|
+
def attribute(*arg,&block)
|
29
|
+
(name, default) = arg
|
30
|
+
short_name = name.to_s.sub(/\?/,"")
|
31
|
+
self.send(:define_method, name) {
|
32
|
+
if instance_variables.include? "@#{short_name}"
|
33
|
+
self.instance_eval "@#{short_name}"
|
36
34
|
else
|
37
|
-
|
35
|
+
if block_given?
|
36
|
+
instance_eval &block
|
37
|
+
else
|
38
|
+
default
|
39
|
+
end
|
38
40
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
41
|
+
}
|
42
|
+
self.send(:define_method, "#{short_name}="){ |value|
|
43
|
+
self.instance_eval "@#{short_name} = value"
|
44
|
+
}
|
45
|
+
end
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
49
|
|
49
50
|
Object.send(:include, AethericalUtils::Attribute)
|
50
|
-
|
51
|
-
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aetherical_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Williams
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
DG139ofzQTE=
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2008-06-
|
33
|
+
date: 2008-06-16 00:00:00 -04:00
|
34
34
|
default_executable:
|
35
35
|
dependencies: []
|
36
36
|
|
metadata.gz.sig
CHANGED
Binary file
|