immutabler 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/lib/immutabler/template/body_template.rb +4 -3
- data/lib/immutabler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268e3ec36585c2d64d289324511a72c3b5e6f002
|
4
|
+
data.tar.gz: 9dd49693446fe3203c83b509cf2b8665d0dba461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f381bfd48c9e42aebd04e4b95e98761a6148c1232c55964aafd8ae89cf3c4df56a40638af5581922bf5f0b06583b3369a5e1cc46c506e49626be0620cda4403
|
7
|
+
data.tar.gz: 6547112c6f65b04c4a447b7733d249e6468d92d80a96ad1f29c3eead995ccc76c0edc353f1bb673c7175948498b3dd322f380a3fcac770ccd31247b7e2d62b91
|
@@ -72,7 +72,7 @@ module Immutabler
|
|
72
72
|
when 'NSInteger'
|
73
73
|
encode_int(arg.name)
|
74
74
|
when 'CGFloat'
|
75
|
-
encode_template(arg.name, 'Float')
|
75
|
+
encode_template(arg.name, 'Float', 'float')
|
76
76
|
when 'double'
|
77
77
|
encode_template(arg.name, 'Double')
|
78
78
|
else
|
@@ -104,8 +104,9 @@ module Immutabler
|
|
104
104
|
template.call(models: models, name: name)
|
105
105
|
end
|
106
106
|
|
107
|
-
def encode_template(arg_name, type, leading_spaces_count = 8)
|
108
|
-
|
107
|
+
def encode_template(arg_name, type, typecast = nil, leading_spaces_count = 8)
|
108
|
+
typecast_expression = typecast ? "(#{typecast})" : ''
|
109
|
+
"#{' ' * leading_spaces_count}[coder encode#{type}:#{typecast_expression}self.#{arg_name} forKey:@\"_#{arg_name}\"];"
|
109
110
|
end
|
110
111
|
def encode_int(arg_name)
|
111
112
|
" if (sizeof(_#{arg_name}) < 8) {\n\
|
data/lib/immutabler/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immutabler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serhij Korochanskyj
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-08-
|
13
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: handlebars
|