babby 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/babby.rb +3 -3
- data/lib/babby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764e6dc0f54af63f950f19974982914c700ee2a2
|
4
|
+
data.tar.gz: 93589f0a075998f6114d1205e5092c68c24703b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d1714959689b7f99da84c6c78893eb955b4dce4f334bde6143b968c105d37399a6bb262ca30bad556a4cfd2091835f24696abc204897d66fe9203b07846ccbd
|
7
|
+
data.tar.gz: 3045a8b99823a24b6735ab9b165ef1192045a20d6ae079cb4e8750a0478da4fff15bf226e8f6b452760771f5ea4e1283f3af7a892d673f3018dd3d7c14e03545
|
data/lib/babby.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require "babby/version"
|
2
2
|
|
3
3
|
STATE_TYPE_MAP = {
|
4
4
|
array: Array
|
@@ -27,8 +27,8 @@ module Babby
|
|
27
27
|
|
28
28
|
if type == :array
|
29
29
|
define_singleton_method name do |value| # define 'setter' for derived class - i.e. DSL 'setup' method a la attr_accessor
|
30
|
-
if not self.instance_variable_get
|
31
|
-
self.instance_variable_set "@#{name}",
|
30
|
+
if not self.instance_variable_get "@#{name}"
|
31
|
+
self.instance_variable_set "@#{name}", state_type ? state_type.new : nil
|
32
32
|
end
|
33
33
|
|
34
34
|
self.instance_variable_get("@#{name}").push(value) # Set the underlying class instance variable to the desired value
|
data/lib/babby/version.rb
CHANGED