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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5cb0ee3a96e1134941bd202ce2da8ad90b76acb
4
- data.tar.gz: c3e8ee60cbe0909df14afa14f3e05e15ffed7b69
3
+ metadata.gz: 268e3ec36585c2d64d289324511a72c3b5e6f002
4
+ data.tar.gz: 9dd49693446fe3203c83b509cf2b8665d0dba461
5
5
  SHA512:
6
- metadata.gz: 5a8a5d02027c9b93c9efc91e26af22672c17d201f926a4b0ad2b4bc2af75f7a259bd31791123b60deced0176502396203754e09d65c6d36ce87415642472508b
7
- data.tar.gz: e7ababe5deb5ff453dba7e67ed3bd299467c29191c96ba34d83127c4037815f14a55e5908248ddf7b58253fc612f42a0594b9814e53e419ac2f0a1a5babdb9e6
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
- "#{' ' * leading_spaces_count}[coder encode#{type}:self.#{arg_name} forKey:@\"_#{arg_name}\"];"
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\
@@ -1,3 +1,3 @@
1
1
  module Immutabler
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
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.3
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-22 00:00:00.000000000 Z
13
+ date: 2016-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: handlebars