inline_templates 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inline_templates.rb +1 -0
- data/lib/inline_templates/buffer_wrapper.rb +3 -1
- data/lib/inline_templates/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: a7fb94853f697e407abafb16028f0a97b1ff3890
|
4
|
+
data.tar.gz: c32da98602fa1183161545e443f13325a5ca69f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df6e7c390591de57e2668101ac183a061e06d9902f45a78cef8e81b7d9e23314ab1b7f53f913ea2a6ae17faf7ed35c4c29aaae4186af55ff05a47a34756722ae
|
7
|
+
data.tar.gz: 52b3ad3309433127d615c387bf86371fcb99678421fa1954ceed9048479760ea252736e641afc784d01237b4114f98c667b5b0232b0ba655b71bf6744564856f
|
data/lib/inline_templates.rb
CHANGED
@@ -2,6 +2,8 @@ module InlineTemplates
|
|
2
2
|
class BufferWrapper < BlankObject
|
3
3
|
make_blank :respond_to?
|
4
4
|
|
5
|
+
IMPLICIT_CAST_METHODS = ::Set.new([ :to_int, :to_ary, :to_str, :to_sym, :to_hash, :to_proc, :to_io ])
|
6
|
+
|
5
7
|
def initialize(object, buffer)
|
6
8
|
@object = object
|
7
9
|
@buffer = buffer
|
@@ -20,7 +22,7 @@ module InlineTemplates
|
|
20
22
|
|
21
23
|
result = @object.__send__(name, *args, &block)
|
22
24
|
|
23
|
-
return result if name.
|
25
|
+
return result if IMPLICIT_CAST_METHODS.include?(name.to_sym)
|
24
26
|
|
25
27
|
BufferWrapper.wrap result, @buffer
|
26
28
|
end
|