acts_as_dynamic 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # <libraries>
2
2
 
3
- require "object"
3
+ require "acts_as_dynamic/object"
4
4
  require "acts_as_dynamic/base"
5
5
  require "acts_as_dynamic/version"
6
6
 
@@ -0,0 +1,40 @@
1
+ # ActsAsDynamic
2
+ module ActsAsDynamic
3
+
4
+ # Base
5
+ module Base
6
+
7
+ # <methods>
8
+
9
+ # Builder
10
+ def initialize args = {}
11
+ args.each_pair do |attribute, value|
12
+ self.send "#{attribute}=", value
13
+ end
14
+ self
15
+ end
16
+
17
+ # Metaclass
18
+ def metaclass
19
+ class << self
20
+ self
21
+ end
22
+ end
23
+
24
+ # Method missing
25
+ def method_missing(attribute, value = "")
26
+ # Assignation?
27
+ if attribute.to_s["="]
28
+ # Adding attribute
29
+ metaclass.send :attr_accessor, attribute.to_s[/[^=]+/]
30
+ self.send attribute, value
31
+ else
32
+ nil
33
+ end
34
+ end
35
+
36
+ # </methods>
37
+
38
+ end
39
+
40
+ end
@@ -0,0 +1,13 @@
1
+ # Class
2
+ class Class
3
+
4
+ # <class methods>
5
+
6
+ # Acts as dynamic
7
+ def acts_as_dynamic
8
+ include ActsAsDynamic::Base
9
+ end
10
+
11
+ # </class methods>
12
+
13
+ end
@@ -0,0 +1,17 @@
1
+ # ActsAsDynamic
2
+ module ActsAsDynamic
3
+
4
+ # Version
5
+ module VERSION
6
+ MAJOR = 0
7
+ MINOR = 0
8
+ TINY = 3
9
+
10
+ STRING = [
11
+ MAJOR,
12
+ MINOR,
13
+ TINY
14
+ ].join(".")
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_dynamic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Juan Colacelli
@@ -28,6 +28,9 @@ extra_rdoc_files: []
28
28
 
29
29
  files:
30
30
  - lib/acts_as_dynamic.rb
31
+ - lib/acts_as_dynamic/base.rb
32
+ - lib/acts_as_dynamic/version.rb
33
+ - lib/acts_as_dynamic/object.rb
31
34
  homepage: https://github.com/juancolacelli/acts_as_dynamic
32
35
  licenses:
33
36
  - MIT