acts_as_metable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acts_as_metable.rb +9 -1
- data/lib/acts_as_metable/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: f84b54d521eaa01f369fce7f7aa3e45538d5cf8a
|
4
|
+
data.tar.gz: b0f1a922cc91c2508f02fad1b38d9a6680f79097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a3d51a21126d7d571ff25769b98aeb05558321421f621bcb10b89f63498b022e7edce78f14f37a0ee981edeb31465b6f54067fd5f180f0cbb499fe090c0d13
|
7
|
+
data.tar.gz: 28a7e993b5200bd82e0ccebec35c9d35b4f4e5cf8b1383589be60386c381b4c74b15855e42151fe4f795cab93e9ec3df51dac169de33abb24e571b1ea5ea7d8b
|
data/lib/acts_as_metable.rb
CHANGED
@@ -5,8 +5,16 @@ module ActsAsMetable
|
|
5
5
|
@tags = []
|
6
6
|
|
7
7
|
class << self
|
8
|
+
def tags &block
|
9
|
+
instance_eval &block
|
10
|
+
end
|
11
|
+
|
8
12
|
def add_tag name, content
|
9
|
-
@tags << { :name => name, :content => content }
|
13
|
+
@tags << { :name => name.to_s, :content => content }
|
14
|
+
end
|
15
|
+
|
16
|
+
def remove_tag name
|
17
|
+
@tags.delete_if { |tag| tag[:name] == name.to_s }
|
10
18
|
end
|
11
19
|
|
12
20
|
def add_model model_name, id
|