groupdocs 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,37 +17,23 @@ module GroupDocs
17
17
 
18
18
  # @attr [Integer] id
19
19
  attr_accessor :id
20
- # @attr [Integer] ownerId
21
- attr_accessor :ownerId
22
- # @attr [Integer] questionnaireId
23
- attr_accessor :questionnaireId
24
- # @attr [Integer] executiveId
25
- attr_accessor :executiveId
26
- # @attr [Integer] approverId
27
- attr_accessor :approverId
28
- # @attr [Integer] datasourceId
29
- attr_accessor :datasourceId
30
- # @attr [Integer] documentId
31
- attr_accessor :documentId
32
- # @attr [Integer] status
20
+ # @attr [Integer] questionnaire_id
21
+ attr_accessor :questionnaire_id
22
+ # @attr [String] questionnaire_name
23
+ attr_accessor :questionnaire_name
24
+ # @attr [GroupDocs::User] owner
25
+ attr_accessor :owner
26
+ # @attr [GroupDocs::User] executive
27
+ attr_accessor :executive
28
+ # @attr [GroupDocs::User] approver
29
+ attr_accessor :approver
30
+ # @attr [Integer] datasource_id
31
+ attr_accessor :datasource_id
32
+ # @attr [Symbol] status
33
33
  attr_accessor :status
34
34
  # @attr [String] guid
35
35
  attr_accessor :guid
36
36
 
37
- # Human-readable accessors
38
- alias_method :owner_id, :ownerId
39
- alias_method :owner_id=, :ownerId=
40
- alias_method :questionnaire_id, :questionnaireId
41
- alias_method :questionnaire_id=, :questionnaireId=
42
- alias_method :executive_id, :executiveId
43
- alias_method :executive_id=, :executiveId=
44
- alias_method :approver_id, :approverId
45
- alias_method :approver_id=, :approverId=
46
- alias_method :datasource_id, :datasourceId
47
- alias_method :datasource_id=, :datasourceId=
48
- alias_method :document_id, :documentId
49
- alias_method :document_id=, :documentId=
50
-
51
37
  #
52
38
  # Converts status to human-readable format.
53
39
  #
@@ -57,6 +43,17 @@ module GroupDocs
57
43
  parse_status(@status)
58
44
  end
59
45
 
46
+ %w(owner executive approver).each do |method|
47
+ #
48
+ # Converts hash of user options to GroupDocs::user object.
49
+ #
50
+ # @param [Hash] options
51
+ #
52
+ define_method(:"#{method}=") do |options|
53
+ instance_variable_set(:"@#{method}", User.new(options)) if options
54
+ end
55
+ end
56
+
60
57
  #
61
58
  # Updates status of execution on server.
62
59
  #
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end # GroupDocs
@@ -18,51 +18,22 @@ describe GroupDocs::Questionnaire::Execution do
18
18
  end
19
19
  end
20
20
 
21
- it { should respond_to(:id) }
22
- it { should respond_to(:id=) }
23
- it { should respond_to(:ownerId) }
24
- it { should respond_to(:ownerId=) }
25
- it { should respond_to(:questionnaireId) }
26
- it { should respond_to(:questionnaireId=) }
27
- it { should respond_to(:executiveId) }
28
- it { should respond_to(:executiveId=) }
29
- it { should respond_to(:approverId) }
30
- it { should respond_to(:approverId=) }
31
- it { should respond_to(:datasourceId) }
32
- it { should respond_to(:datasourceId=) }
33
- it { should respond_to(:documentId) }
34
- it { should respond_to(:documentId=) }
35
- it { should respond_to(:status) }
36
- it { should respond_to(:status=) }
37
- it { should respond_to(:guid) }
38
- it { should respond_to(:guid=) }
39
-
40
- it 'has human-readable accessors' do
41
- subject.should respond_to(:owner_id)
42
- subject.should respond_to(:owner_id=)
43
- subject.should respond_to(:questionnaire_id)
44
- subject.should respond_to(:questionnaire_id=)
45
- subject.should respond_to(:executive_id)
46
- subject.should respond_to(:executive_id=)
47
- subject.should respond_to(:approver_id)
48
- subject.should respond_to(:approver_id=)
49
- subject.should respond_to(:datasource_id)
50
- subject.should respond_to(:datasource_id=)
51
- subject.should respond_to(:document_id)
52
- subject.should respond_to(:document_id=)
53
- subject.method(:owner_id).should == subject.method(:ownerId)
54
- subject.method(:owner_id=).should == subject.method(:ownerId=)
55
- subject.method(:questionnaire_id).should == subject.method(:questionnaireId)
56
- subject.method(:questionnaire_id=).should == subject.method(:questionnaireId=)
57
- subject.method(:executive_id).should == subject.method(:executiveId)
58
- subject.method(:executive_id=).should == subject.method(:executiveId=)
59
- subject.method(:approver_id).should == subject.method(:approverId)
60
- subject.method(:approver_id=).should == subject.method(:approverId=)
61
- subject.method(:datasource_id).should == subject.method(:datasourceId)
62
- subject.method(:datasource_id=).should == subject.method(:datasourceId=)
63
- subject.method(:document_id).should == subject.method(:documentId)
64
- subject.method(:document_id=).should == subject.method(:documentId=)
65
- end
21
+ it { should respond_to(:id) }
22
+ it { should respond_to(:id=) }
23
+ it { should respond_to(:questionnaire_id) }
24
+ it { should respond_to(:questionnaire_id=) }
25
+ it { should respond_to(:owner) }
26
+ it { should respond_to(:owner=) }
27
+ it { should respond_to(:executive) }
28
+ it { should respond_to(:executive=) }
29
+ it { should respond_to(:approver) }
30
+ it { should respond_to(:approver=) }
31
+ it { should respond_to(:datasource_id) }
32
+ it { should respond_to(:datasource_id=) }
33
+ it { should respond_to(:status) }
34
+ it { should respond_to(:status=) }
35
+ it { should respond_to(:guid) }
36
+ it { should respond_to(:guid=) }
66
37
 
67
38
  describe '#set_status!' do
68
39
  before(:each) do
@@ -4,17 +4,21 @@
4
4
  "executions":
5
5
  [
6
6
  {
7
- "questionnaireId": 456,
8
- "executiveId": 789,
9
- "approverId": 987,
10
- "datasourceId": 654,
7
+ "questionnaire_id": 456,
8
+ "executive": {
9
+ "id": 789
10
+ },
11
+ "approver": {
12
+ "id": 987
13
+ },
14
+ "datasource_id": 654,
11
15
  "status": "Closed"
12
16
  },
13
17
  {
14
- "questionnaireId": 111,
15
- "executiveId": 222,
16
- "approverId": null,
17
- "datasourceId": null,
18
+ "questionnaire_id": 111,
19
+ "executive": null,
20
+ "approver": null,
21
+ "datasource_id": null,
18
22
  "status": "Executed"
19
23
  }
20
24
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-21 00:00:00.000000000 Z
12
+ date: 2012-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &7184720 !ruby/object:Gem::Requirement
16
+ requirement: &12447860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *7184720
24
+ version_requirements: *12447860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &7199340 !ruby/object:Gem::Requirement
27
+ requirement: &12462460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *7199340
35
+ version_requirements: *12462460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-hmac
38
- requirement: &7198000 !ruby/object:Gem::Requirement
38
+ requirement: &12461140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *7198000
46
+ version_requirements: *12461140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &7196220 !ruby/object:Gem::Requirement
49
+ requirement: &12459460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *7196220
57
+ version_requirements: *12459460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &7195200 !ruby/object:Gem::Requirement
60
+ requirement: &12458440 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *7195200
68
+ version_requirements: *12458440
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &7194280 !ruby/object:Gem::Requirement
71
+ requirement: &12457540 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *7194280
79
+ version_requirements: *12457540
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &7192780 !ruby/object:Gem::Requirement
82
+ requirement: &12470580 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *7192780
90
+ version_requirements: *12470580
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &7205080 !ruby/object:Gem::Requirement
93
+ requirement: &12468260 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.8'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *7205080
101
+ version_requirements: *12468260
102
102
  description: Ruby SDK for GroupDocs REST API
103
103
  email: p0deje@gmail.com
104
104
  executables: []
@@ -256,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  segments:
258
258
  - 0
259
- hash: -885604598236996557
259
+ hash: 2406199211675582739
260
260
  required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  none: false
262
262
  requirements:
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  segments:
267
267
  - 0
268
- hash: -885604598236996557
268
+ hash: 2406199211675582739
269
269
  requirements: []
270
270
  rubyforge_project:
271
271
  rubygems_version: 1.8.10