rpcoder 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/templates/Type.erb +14 -0
- data/rpcoder.gemspec +1 -1
- data/spec/fixtures/foo/bar/Mail.as +34 -1
- data/spec/rpcoder_spec.rb +1 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/templates/Type.erb
CHANGED
@@ -14,6 +14,11 @@ package <%= name_space %>
|
|
14
14
|
return _<%= field.name %>;
|
15
15
|
}
|
16
16
|
|
17
|
+
public function set <%= field.name %>(<%= field.name %>:<%= field.array_or_type %>):void
|
18
|
+
{
|
19
|
+
_<%= field.name %> = <%= field.name %>;
|
20
|
+
}
|
21
|
+
|
17
22
|
<%- end -%>
|
18
23
|
public function <%= type.name %>(object:Object = null)
|
19
24
|
{
|
@@ -31,6 +36,15 @@ package <%= name_space %>
|
|
31
36
|
}
|
32
37
|
}
|
33
38
|
|
39
|
+
public static function create(<%= type.fields.map {|i| "#{i.name}:#{i.array_or_type}" }.join(', ') %>):<%= type.name %>
|
40
|
+
{
|
41
|
+
var instance:<%= type.name %> = new <%= type.name %>();
|
42
|
+
<%- type.fields.each do |field| -%>
|
43
|
+
instance.<%= field.name %> = <%= field.name %>;
|
44
|
+
<%- end -%>
|
45
|
+
return instance;
|
46
|
+
}
|
47
|
+
|
34
48
|
public function toString():String
|
35
49
|
{
|
36
50
|
return [<%= type.fields.map {|i| "_#{i.name}" }.join(', ') %>].join(', ');
|
data/rpcoder.gemspec
CHANGED
@@ -6,29 +6,62 @@ package foo.bar
|
|
6
6
|
{
|
7
7
|
private var _subject:String;
|
8
8
|
private var _body:String;
|
9
|
+
private var _cc:Array;
|
9
10
|
|
10
11
|
public function get subject():String
|
11
12
|
{
|
12
13
|
return _subject;
|
13
14
|
}
|
14
15
|
|
16
|
+
public function set subject(subject:String):void
|
17
|
+
{
|
18
|
+
_subject = subject;
|
19
|
+
}
|
20
|
+
|
15
21
|
public function get body():String
|
16
22
|
{
|
17
23
|
return _body;
|
18
24
|
}
|
19
25
|
|
26
|
+
public function set body(body:String):void
|
27
|
+
{
|
28
|
+
_body = body;
|
29
|
+
}
|
30
|
+
|
31
|
+
public function get cc():Array
|
32
|
+
{
|
33
|
+
return _cc;
|
34
|
+
}
|
35
|
+
|
36
|
+
public function set cc(cc:Array):void
|
37
|
+
{
|
38
|
+
_cc = cc;
|
39
|
+
}
|
40
|
+
|
20
41
|
public function Mail(object:Object = null)
|
21
42
|
{
|
22
43
|
if (object)
|
23
44
|
{
|
24
45
|
_subject = object['subject'];
|
25
46
|
_body = object['body'];
|
47
|
+
_cc = new Array();
|
48
|
+
for each(var elem:Object in object['cc'])
|
49
|
+
_cc.push(elem);
|
26
50
|
}
|
27
51
|
}
|
28
52
|
|
53
|
+
public static function create(subject:String, body:String, cc:Array):Mail
|
54
|
+
{
|
55
|
+
var instance:Mail = new Mail();
|
56
|
+
instance.subject = subject;
|
57
|
+
instance.body = body;
|
58
|
+
instance.cc = cc;
|
59
|
+
return instance;
|
60
|
+
}
|
61
|
+
|
29
62
|
public function toString():String
|
30
63
|
{
|
31
|
-
return [_subject, _body].join(', ');
|
64
|
+
return [_subject, _body, _cc].join(', ');
|
32
65
|
}
|
33
66
|
}
|
34
67
|
}
|
data/spec/rpcoder_spec.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rpcoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- jugyo
|
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
125
|
requirements:
|
126
126
|
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
hash: -
|
128
|
+
hash: -1766578464661972759
|
129
129
|
segments:
|
130
130
|
- 0
|
131
131
|
version: "0"
|