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 CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.3
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rpcoder}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo", "Toshiyuki Hirooka"]
@@ -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
@@ -30,6 +30,7 @@ describe "RPCoder" do
30
30
  RPCoder.type "Mail" do |t|
31
31
  t.add_field :subject, :String
32
32
  t.add_field :body, :String
33
+ t.add_field :cc, :String, {:array? => true}
33
34
  end
34
35
  end
35
36
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rpcoder
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.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: -844195454282483269
128
+ hash: -1766578464661972759
129
129
  segments:
130
130
  - 0
131
131
  version: "0"