html_format 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html_format/core_ext.rb +6 -2
- data/lib/html_format/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65ba6be4011eca708cdbcc238a182d0d758074cb4e53c54d5bef84d48f0e437f
|
4
|
+
data.tar.gz: 9a715f1a46abc3baf6e8658d4e639f35d0d4232fa8735c13f9505a1d940e95a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596ee31c1f12ceee1fcd511453f897fbc2b19caa4dd2d1ef7c0596a7000c1aa7f43cac5c0b891ce57160ab0d7f9148f2301e98929d2553156bae7ca93b08616d
|
7
|
+
data.tar.gz: 745df4d51db228c6643f4a2d65ee04ebeeca86cc61339897c2e6f4ead2dfb24b1baea3119bc65b8cb4366658546b2ac371f086f8fff09a2ac00b9529650a3965
|
data/lib/html_format/core_ext.rb
CHANGED
@@ -17,9 +17,13 @@ end
|
|
17
17
|
Kernel.class_eval do
|
18
18
|
private
|
19
19
|
|
20
|
-
def html_format(object,
|
20
|
+
def html_format(object = nil, options = {}, &block)
|
21
|
+
if block
|
22
|
+
options = object || {}
|
23
|
+
object = yield
|
24
|
+
end
|
21
25
|
if object.respond_to?(:to_html)
|
22
|
-
object.to_html
|
26
|
+
object.to_html(options)
|
23
27
|
else
|
24
28
|
HtmlFormat.generate(object, options)
|
25
29
|
end
|
data/lib/html_format/version.rb
CHANGED