ribose 0.4.1 → 0.5.0

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.
@@ -1,273 +1,302 @@
1
- # Ribose
1
+ = Ribose
2
2
 
3
- [![Build
4
- Status](https://travis-ci.org/riboseinc/ribose-ruby.svg?branch=master)](https://travis-ci.org/riboseinc/ribose-ruby)
5
- [![Code
6
- Climate](https://codeclimate.com/github/riboseinc/ribose-ruby/badges/gpa.svg)](https://codeclimate.com/github/riboseinc/ribose-ruby)
7
- [![Gem Version](https://badge.fury.io/rb/ribose.svg)](https://badge.fury.io/rb/ribose)
3
+ image:https://travis-ci.org/riboseinc/ribose-ruby.svg?branch=master[Build Status,link=https://travis-ci.org/riboseinc/ribose-ruby] image:https://codeclimate.com/github/riboseinc/ribose-ruby/badges/gpa.svg[Code Climate,link=https://codeclimate.com/github/riboseinc/ribose-ruby] image:https://badge.fury.io/rb/ribose.svg[Gem Version,link=https://badge.fury.io/rb/ribose]
8
4
 
9
5
  The Ruby Interface to the Ribose API.
10
6
 
11
- ## Installation
7
+ == Installation
12
8
 
13
9
  Add this line to your application's Gemfile:
14
10
 
15
- ```ruby
11
+ [source,ruby]
12
+ ----
16
13
  gem "ribose"
17
- ```
14
+ ----
18
15
 
19
16
  And then execute:
20
17
 
21
- ```sh
18
+ [source,sh]
19
+ ----
22
20
  $ bundle install
23
- ```
21
+ ----
24
22
 
25
23
  Or install it yourself as:
26
24
 
27
- ```sh
25
+ [source,sh]
26
+ ----
28
27
  $ gem install ribose
29
- ```
28
+ ----
30
29
 
31
- ## Configure
30
+ == Configure
32
31
 
33
- We need to setup Ribose API configuration before we can perform any request
34
- throughout this client
32
+ We need to setup Ribose API configuration before we can perform any request throughout this client
35
33
 
36
- First, obtain an API token [as per this Github wiki](https://github.com/riboseinc/ribose-api/wiki/Obtaining-the-API-Token).
37
- Using the token, configure the client by adding an initializer with the
38
- following code:
34
+ First, obtain an API token https://github.com/riboseinc/ribose-api/wiki/Obtaining-the-API-Token[as per this Github wiki].
35
+ Using the token, configure the client by adding an initializer with the following code:
39
36
 
40
- ```ruby
37
+ [source,ruby]
38
+ ----
41
39
  Ribose.configure do |config|
42
- config.api_token = "SECRET_API_TOKEN"
43
- config.user_email = "your-email@example.com"
40
+ config.user_email = "your-email@example.com"
41
+ config.user_password = "your-password"
42
+
43
+ # INFRA_ID is a 7-digit id, which can be found from the network requests
44
+ # e.g. ed6af7b for current production environment
45
+ config.api_host = URI.parse('https://app-INFRA_ID.ribose.com')
44
46
 
45
47
  # There are also some default configurations. Normally you do not need to
46
48
  # change those unless you have some very specific use cases.
47
49
  #
48
50
  # config.debug_mode = false
49
51
  # config.api_host = "www.ribose.com"
52
+
53
+ # Deprecated
54
+ # config.api_token = "SECRET_API_TOKEN"
55
+ # config.api_email = "your-email@example.com"
50
56
  end
51
- ```
57
+ ----
52
58
 
53
59
  Or:
54
60
 
55
- ```ruby
56
- Ribose.configuration.api_token = "SECRET_API_TOKEN"
61
+ [source,ruby]
62
+ ----
63
+ Ribose.configuration.api_host = "https://app-INFRA_ID.ribose.com"
57
64
  Ribose.configuration.user_email = "your-email@example.com"
65
+ Ribose.configuration.user_password = "your-password"
58
66
  ```
67
+ =======
68
+ ----
59
69
 
60
- ## Usage
70
+ == Usage
61
71
 
62
- ### App Data
72
+ === App Data
63
73
 
64
- #### List app data
74
+ ==== List app data
65
75
 
66
76
  App data can be retrieved using the `AppData.all` interface.
67
77
 
68
- ```ruby
78
+ [source,ruby]
79
+ ----
69
80
  Ribose::AppData.all
70
- ```
81
+ ----
71
82
 
72
- ### App Relation
83
+ === App Relation
73
84
 
74
- #### List app relations
85
+ ==== List app relations
75
86
 
76
- To retrieve the list of app relations, we can use the `AppRelation.all`
77
- interface.
87
+ To retrieve the list of app relations, we can use the `AppRelation.all` interface.
78
88
 
79
- ```ruby
89
+ [source,ruby]
90
+ ----
80
91
  Ribose::AppRelation.all
81
- ```
92
+ ----
82
93
 
83
- #### Fetch an app relation
94
+ ==== Fetch an app relation
84
95
 
85
- To retrieve the details for a specific app relation, we can use the following
86
- interface.
96
+ To retrieve the details for a specific app relation, we can use the following interface.
87
97
 
88
- ```ruby
98
+ [source,ruby]
99
+ ----
89
100
  Ribose::AppRelation.fetch(app_relation_id)
90
- ```
101
+ ----
91
102
 
92
- ### Profile
103
+ === Profile
93
104
 
94
- #### Fetch user profile
105
+ ==== Fetch user profile
95
106
 
96
- ```ruby
107
+ [source,ruby]
108
+ ----
97
109
  Ribose::Profile.fetch
98
- ```
110
+ ----
99
111
 
100
- #### Update user profile
112
+ ==== Update user profile
101
113
 
102
- ```ruby
114
+ [source,ruby]
115
+ ----
103
116
  Ribose::Profile.update(first_name: "John", last_name: "Doe")
104
- ```
117
+ ----
105
118
 
106
- #### Set user login
119
+ ==== Set user login
107
120
 
108
- ```ruby
121
+ [source,ruby]
122
+ ----
109
123
  Ribose::Profile.set_login(login_name)
110
- ```
124
+ ----
111
125
 
112
- ### Settings
126
+ === Settings
113
127
 
114
- #### List user's settings
128
+ ==== List user's settings
115
129
 
116
- To list user's settings we can use the `Setting.all` interface, and it will
117
- return all of the user's settings.
130
+ To list user's settings we can use the `Setting.all` interface, and it will return all of the user's settings.
118
131
 
119
- ```ruby
132
+ [source,ruby]
133
+ ----
120
134
  Ribose::Setting.all
121
- ```
135
+ ----
122
136
 
123
- #### Fetch a setting
137
+ ==== Fetch a setting
124
138
 
125
- To fetch the details for any specific settings we can use the `Setting.fetch`
126
- interface with the specific Setting ID, and it will return the details for that
127
- setting.
139
+ To fetch the details for any specific settings we can use the `Setting.fetch` interface with the specific Setting ID, and it will return the details for that setting.
128
140
 
129
- ```ruby
141
+ [source,ruby]
142
+ ----
130
143
  Ribose::Setting.fetch(setting_id)
131
- ```
144
+ ----
132
145
 
133
- #### Update a setting
146
+ ==== Update a setting
134
147
 
135
- ```ruby
148
+ [source,ruby]
149
+ ----
136
150
  Ribose::Setting.update(setting_id, **new_updated_attributes_hash)
137
- ```
151
+ ----
138
152
 
139
- ### Spaces
153
+ === Spaces
140
154
 
141
- #### List user's Spaces
155
+ ==== List user's Spaces
142
156
 
143
- To list a user's Spaces we can use the `Space.all` interface, and it will
144
- retrieve all of the Spaces for the currently configured user.
157
+ To list a user's Spaces we can use the `Space.all` interface, and it will retrieve all of the Spaces for the currently configured user.
145
158
 
146
- ```ruby
159
+ [source,ruby]
160
+ ----
147
161
  Ribose::Space.all
148
- ```
162
+ ----
149
163
 
150
- #### Fetch a user Space
164
+ ==== Fetch a user Space
151
165
 
152
166
  To retrieve the details for a Space we can use the `Space.fetch(space_id)`.
153
167
 
154
- ```ruby
168
+ [source,ruby]
169
+ ----
155
170
  Ribose::Space.fetch(space_id)
156
- ```
171
+ ----
157
172
 
158
- #### Create a user Space
173
+ ==== Create a user Space
159
174
 
160
175
  To create a new user Space,
161
176
 
162
- ```ruby
177
+ [source,ruby]
178
+ ----
163
179
  Ribose::Space.create(
164
180
  access: "private",
165
181
  space_category_id: 12,
166
182
  name: "The amazing Ribose Space",
167
183
  description: "Description about your Space"
168
184
  )
169
- ```
185
+ ----
170
186
 
171
- #### Update a user Space
187
+ ==== Update a user Space
172
188
 
173
- ```ruby
189
+ [source,ruby]
190
+ ----
174
191
  Ribose::Space.update("space_uuid", name: "New updated name", **other_attributes)
175
- ```
192
+ ----
176
193
 
177
- #### Remove a user Space
194
+ ==== Remove a user Space
178
195
 
179
196
  To remove an existing Space,
180
197
 
181
- ```ruby
198
+ [source,ruby]
199
+ ----
182
200
  Ribose::Space.remove(space_uuid, confirmation: true)
183
- ```
201
+ ----
184
202
 
185
- ### Members
203
+ === Members
186
204
 
187
205
  The members endpoint are Space-specific.
188
206
 
189
- To retrieve the member details under any specific Space, we can use this
190
- interface.
207
+ To retrieve the member details under any specific Space, we can use this interface.
191
208
 
192
- #### List space members
209
+ ==== List space members
193
210
 
194
211
  To retrieve the list of members,
195
212
 
196
- ```ruby
213
+ [source,ruby]
214
+ ----
197
215
  Ribose::Member.all(space_id, options)
198
- ```
216
+ ----
199
217
 
200
- #### Delete a space member
218
+ ==== Delete a space member
201
219
 
202
- ```ruby
220
+ [source,ruby]
221
+ ----
203
222
  Ribose::Member.delete(space_id, member_id, options)
204
- ```
223
+ ----
205
224
 
206
- #### Fetch Member Role
225
+ ==== Fetch Member Role
207
226
 
208
- ```ruby
227
+ [source,ruby]
228
+ ----
209
229
  Ribose::MemberRole.fetch(space_id, member_id, options)
210
- ```
230
+ ----
211
231
 
212
- #### Assign a role to member
232
+ ==== Assign a role to member
213
233
 
214
- ```ruby
234
+ [source,ruby]
235
+ ----
215
236
  Ribose::MemberRole.assign(space_id, member_id, role_id)
216
- ```
237
+ ----
217
238
 
218
- ### Files
239
+ === Files
219
240
 
220
- #### List of Files
241
+ ==== List of Files
221
242
 
222
243
  To retrieve the list of files for any specific Space,
223
244
 
224
- ```ruby
245
+ [source,ruby]
246
+ ----
225
247
  Ribose::SpaceFile.all(space_id, options)
226
- ```
248
+ ----
227
249
 
228
- #### Fetch a file details
250
+ ==== Fetch a file details
229
251
 
230
- ```ruby
252
+ [source,ruby]
253
+ ----
231
254
  Ribose::SpaceFile.fetch(space_id, file_id, options = {})
232
- ```
255
+ ----
233
256
 
234
- #### Fetch a file icon
257
+ ==== Fetch a file icon
235
258
 
236
- ```ruby
259
+ [source,ruby]
260
+ ----
237
261
  Ribose::SpaceFile.fetch_icon(space_id, file_id, options = {})
238
- ```
262
+ ----
239
263
 
240
- #### Create a file upload
264
+ ==== Create a file upload
241
265
 
242
- ```ruby
266
+ [source,ruby]
267
+ ----
243
268
  Ribose::SpaceFile.create(space_id, file: "The complete file path", **attributes)
244
- ```
269
+ ----
245
270
 
246
- #### Update a space file
271
+ ==== Update a space file
247
272
 
248
- ```ruby
273
+ [source,ruby]
274
+ ----
249
275
  Ribose::SpaceFile.update(space_id, file_id, new_file_attributes = {})
250
- ```
276
+ ----
251
277
 
252
- #### Remove a space file
278
+ ==== Remove a space file
253
279
 
254
- ```ruby
280
+ [source,ruby]
281
+ ----
255
282
  Ribose::SpaceFile.delete(space_id, file_id)
256
- ```
283
+ ----
257
284
 
258
- ### File Version
285
+ === File Version
259
286
 
260
- #### Fetch file version
287
+ ==== Fetch file version
261
288
 
262
- ```ruby
289
+ [source,ruby]
290
+ ----
263
291
  Ribose::FileVersion.fetch(
264
292
  space_id: space_id, file_id: file_id, version_id: version_id
265
293
  )
266
- ```
294
+ ----
267
295
 
268
- #### Create a new file version
296
+ ==== Create a new file version
269
297
 
270
- ```ruby
298
+ [source,ruby]
299
+ ----
271
300
  Ribose::FileVersion.create(
272
301
  space_id: your_space_id,
273
302
  file_id: existing_file_id_in_space,
@@ -275,206 +304,229 @@ Ribose::FileVersion.create(
275
304
 
276
305
  **any_other_additional_attributes
277
306
  )
278
- ```
307
+ ----
279
308
 
280
- ### Conversations
309
+ === Conversations
281
310
 
282
- #### Listing Space Conversations
311
+ ==== Listing Space Conversations
283
312
 
284
- ```ruby
313
+ [source,ruby]
314
+ ----
285
315
  Ribose::Conversation.all(space_id, options = {})
286
- ```
316
+ ----
287
317
 
288
- #### Retrieve a conversation details
318
+ ==== Retrieve a conversation details
289
319
 
290
- ```ruby
320
+ [source,ruby]
321
+ ----
291
322
  Ribose::Conversation.fetch(space_id, conversation_id)
292
- ```
323
+ ----
293
324
 
294
- #### Create A New Conversation
325
+ ==== Create A New Conversation
295
326
 
296
- ```ruby
327
+ [source,ruby]
328
+ ----
297
329
  Ribose::Conversation.create(
298
330
  space_id, name: "Sample conversation", tag_list: "sample, conversation"
299
331
  )
300
- ```
332
+ ----
301
333
 
302
- #### Update a conversation
334
+ ==== Update a conversation
303
335
 
304
- ```ruby
336
+ [source,ruby]
337
+ ----
305
338
  Ribose::Conversation.update(space_id, conversation_id, new_attributes_hash)
306
- ```
339
+ ----
307
340
 
308
- #### Remove A Conversation
341
+ ==== Remove A Conversation
309
342
 
310
- ```ruby
343
+ [source,ruby]
344
+ ----
311
345
  Ribose::Conversation.destroy(space_id: "space_id", conversation_id: "12345")
312
- ```
346
+ ----
313
347
 
314
- #### Mark a conversation as favorite
348
+ ==== Mark a conversation as favorite
315
349
 
316
- ```ruby
350
+ [source,ruby]
351
+ ----
317
352
  Ribose::Conversation.mark_as_favorite(space_id, conversation_id)
318
- ```
353
+ ----
319
354
 
320
- ### Message
355
+ === Message
321
356
 
322
- #### List Conversation Messages
357
+ ==== List Conversation Messages
323
358
 
324
- ```ruby
359
+ [source,ruby]
360
+ ----
325
361
  Ribose::Message.all(space_id: space_uuid, conversation_id: conversation_uuid)
326
- ```
362
+ ----
327
363
 
328
- #### Create a new message
364
+ ==== Create a new message
329
365
 
330
- ```ruby
366
+ [source,ruby]
367
+ ----
331
368
  Ribose::Message.create(
332
369
  space_id: space_uuid,
333
370
  conversation_id: conversation_uuid,
334
371
  contents: "Provide your message body here",
335
372
  )
336
- ```
373
+ ----
337
374
 
338
- #### Update an existing message
375
+ ==== Update an existing message
339
376
 
340
- ```ruby
377
+ [source,ruby]
378
+ ----
341
379
  Ribose::Message.update(
342
380
  space_id: space_uuid,
343
381
  message_id: message_uuid,
344
382
  conversation_id: conversation_uuid,
345
383
  contents: "The new content for message",
346
384
  )
347
- ```
385
+ ----
348
386
 
349
- #### Remove a message
387
+ ==== Remove a message
350
388
 
351
- ```ruby
389
+ [source,ruby]
390
+ ----
352
391
  Ribose::Message.remove(
353
392
  space_id: space_uuid,
354
393
  message_id: message_uuid,
355
394
  conversation_id: conversation_uuid,
356
395
  )
357
- ```
396
+ ----
358
397
 
359
- ### Feeds
398
+ === Feeds
360
399
 
361
- #### List user feeds
400
+ ==== List user feeds
362
401
 
363
402
  To retrieve the list of user feeds,
364
403
 
365
- ```ruby
404
+ [source,ruby]
405
+ ----
366
406
  Ribose::Feed.all
367
- ```
407
+ ----
368
408
 
369
- ### Widgets
409
+ === Widgets
370
410
 
371
- #### List widgets
411
+ ==== List widgets
372
412
 
373
413
  To retrieve the list of widgets,
374
414
 
375
- ```ruby
415
+ [source,ruby]
416
+ ----
376
417
  Ribose::Widget.all
377
- ```
418
+ ----
378
419
 
379
- ### Stream
420
+ === Stream
380
421
 
381
- #### List of stream notifications
422
+ ==== List of stream notifications
382
423
 
383
424
  To retrieve the list of notifications,
384
425
 
385
- ```ruby
426
+ [source,ruby]
427
+ ----
386
428
  Ribose::Stream.all
387
- ```
429
+ ----
388
430
 
389
- ### Leaderboard
431
+ === Leaderboard
390
432
 
391
- #### Retrieve the current leadership board
433
+ ==== Retrieve the current leadership board
392
434
 
393
435
  To retrieve the current leadership board,
394
436
 
395
- ```ruby
437
+ [source,ruby]
438
+ ----
396
439
  Ribose::Leaderboard.all
397
- ```
440
+ ----
398
441
 
399
- ### Connections
442
+ === Connections
400
443
 
401
- #### List of connections
444
+ ==== List of connections
402
445
 
403
- To retrieve the list of connections, we can use the `Connection.all` interface
404
- and it will return the connection as `Sawyer::Resource`.
446
+ To retrieve the list of connections, we can use the `Connection.all` interface and it will return the connection as `Sawyer::Resource`.
405
447
 
406
- ```ruby
448
+ [source,ruby]
449
+ ----
407
450
  Ribose::Connection.all
408
- ```
451
+ ----
409
452
 
410
- #### Disconnect a connection
453
+ ==== Disconnect a connection
411
454
 
412
- To disconnect with an existing connection, we can use `Connection.disconnect`
413
- interface as following. This expect us to provide the connection id, and it also
414
- support an additional options hash to provide custom options.
455
+ To disconnect with an existing connection, we can use `Connection.disconnect` interface as following.
456
+ This expect us to provide the connection id, and it also support an additional options hash to provide custom options.
415
457
 
416
- ```ruby
458
+ [source,ruby]
459
+ ----
417
460
  Ribose::Connection.disconnect(connection_id, options)
418
- ```
461
+ ----
419
462
 
420
- #### Connection suggestions
463
+ ==== Connection suggestions
421
464
 
422
465
  To retrieve the list of user connection suggestions,
423
466
 
424
- ```ruby
467
+ [source,ruby]
468
+ ----
425
469
  Ribose::Connection.suggestions
426
- ```
470
+ ----
427
471
 
428
- ### Invitations
472
+ === Invitations
429
473
 
430
- #### List connection invitations
474
+ ==== List connection invitations
431
475
 
432
- ```ruby
476
+ [source,ruby]
477
+ ----
433
478
  Ribose::ConnectionInvitation.all
434
- ```
479
+ ----
435
480
 
436
- #### List Space invitations
481
+ ==== List Space invitations
437
482
 
438
- ```ruby
483
+ [source,ruby]
484
+ ----
439
485
  Ribose::SpaceInvitation.all
440
- ```
486
+ ----
441
487
 
442
- #### Fetch a connection invitation
488
+ ==== Fetch a connection invitation
443
489
 
444
- ```ruby
490
+ [source,ruby]
491
+ ----
445
492
  Ribose::ConnectionInvitation.fetch(invitation_id)
446
- ```
493
+ ----
447
494
 
448
- #### Create mass connection invitations
495
+ ==== Create mass connection invitations
449
496
 
450
- ```ruby
497
+ [source,ruby]
498
+ ----
451
499
  Ribose::ConnectionInvitation.create(
452
500
  emails: ["email-one@example.com", "email-two@example.com"],
453
501
  body: "This contains the details message about the invitation",
454
502
  )
455
- ```
503
+ ----
456
504
 
457
- #### Accept a connection invitation
505
+ ==== Accept a connection invitation
458
506
 
459
- ```ruby
507
+ [source,ruby]
508
+ ----
460
509
  Ribose::ConnectionInvitation.accept(invitation_id)
461
- ```
510
+ ----
462
511
 
463
- #### Reject a connection invitation
512
+ ==== Reject a connection invitation
464
513
 
465
- ```ruby
514
+ [source,ruby]
515
+ ----
466
516
  Ribose::ConnectionInvitation.reject(invitation_id)
467
- ```
517
+ ----
468
518
 
469
- #### Cancel a connection invitation
519
+ ==== Cancel a connection invitation
470
520
 
471
- ```ruby
521
+ [source,ruby]
522
+ ----
472
523
  Ribose::ConnectionInvitation.cancel(invitation_id)
473
- ```
524
+ ----
474
525
 
475
- #### Invite user to a Space
526
+ ==== Invite user to a Space
476
527
 
477
- ```ruby
528
+ [source,ruby]
529
+ ----
478
530
  Ribose::SpaceInvitation.create(
479
531
  state: "0",
480
532
  space_id: "123_456_789",
@@ -482,141 +534,160 @@ Ribose::SpaceInvitation.create(
482
534
  type: "Invitation::ToSpace",
483
535
  body: "Please join to this amazing Space",
484
536
  )
485
- ```
537
+ ----
486
538
 
487
- #### Create Space invitation - Mass
539
+ ==== Create Space invitation - Mass
488
540
 
489
- ```ruby
541
+ [source,ruby]
542
+ ----
490
543
  Ribose::SpaceInvitation.mass_create(
491
544
  space_id,
492
545
  emails: ["email-one@example.com"],
493
546
  role_ids: ["role-for-email-address-in-sequance"],
494
547
  body: "The complete message body for the invitation",
495
548
  )
496
- ```
549
+ ----
497
550
 
498
- #### Update a Space invitation
551
+ ==== Update a Space invitation
499
552
 
500
- ```ruby
553
+ [source,ruby]
554
+ ----
501
555
  Ribose::SpaceInvitation.update(invitation_id, new_attributes_hash)
502
- ```
556
+ ----
503
557
 
504
- #### Accept a Space invitation
558
+ ==== Accept a Space invitation
505
559
 
506
- ```ruby
560
+ [source,ruby]
561
+ ----
507
562
  Ribose::SpaceInvitation.accept(invitation_id)
508
- ```
563
+ ----
509
564
 
510
- #### Resend a Space invitation
565
+ ==== Resend a Space invitation
511
566
 
512
- ```ruby
567
+ [source,ruby]
568
+ ----
513
569
  Ribose::SpaceInvitation.resend(invitation_id)
514
- ```
570
+ ----
515
571
 
516
- #### Reject a Space invitation
572
+ ==== Reject a Space invitation
517
573
 
518
- ```ruby
574
+ [source,ruby]
575
+ ----
519
576
  Ribose::SpaceInvitation.reject(invitation_id)
520
- ```
577
+ ----
521
578
 
522
- #### Cancel a Space invitation
579
+ ==== Cancel a Space invitation
523
580
 
524
- ```ruby
581
+ [source,ruby]
582
+ ----
525
583
  Ribose::SpaceInvitation.cancel(invitation_id)
526
- ```
584
+ ----
527
585
 
528
- ### Join Space Request
586
+ === Join Space Request
529
587
 
530
- #### List Join Space Requests
588
+ ==== List Join Space Requests
531
589
 
532
- ```ruby
590
+ [source,ruby]
591
+ ----
533
592
  Ribose::JoinSpaceRequest.all
534
- ```
593
+ ----
535
594
 
536
- #### Fetch a join space request
595
+ ==== Fetch a join space request
537
596
 
538
- ```ruby
597
+ [source,ruby]
598
+ ----
539
599
  Ribose::JoinSpaceRequest.fetch(request_id)
540
- ```
600
+ ----
541
601
 
542
- #### Create a Join Space Request
602
+ ==== Create a Join Space Request
543
603
 
544
- ```ruby
604
+ [source,ruby]
605
+ ----
545
606
  Ribose::JoinSpaceRequest.create(
546
607
  state: 0,
547
608
  Space_id: 123_456_789,
548
609
  type: "Invitation::JoinSpaceRequest",
549
610
  body: "Hi, I would like to join to your Space",
550
611
  )
551
- ```
612
+ ----
552
613
 
553
- #### Accept a Join Space Request
614
+ ==== Accept a Join Space Request
554
615
 
555
- ```ruby
616
+ [source,ruby]
617
+ ----
556
618
  Ribose::JoinSpaceRequest.accept(invitation_id)
557
- ```
619
+ ----
558
620
 
559
- #### Reject a Join Space Requests
621
+ ==== Reject a Join Space Requests
560
622
 
561
- ```ruby
623
+ [source,ruby]
624
+ ----
562
625
  Ribose::JoinSpaceRequest.reject(invitation_id)
563
- ```
626
+ ----
564
627
 
565
- #### Update an Join Space Requests
628
+ ==== Update an Join Space Requests
566
629
 
567
- ```ruby
630
+ [source,ruby]
631
+ ----
568
632
  Ribose::JoinSpaceRequest.update(invitation_id, new_attributes_hash)
569
- ```
633
+ ----
570
634
 
571
- ### Calendar
635
+ === Calendar
572
636
 
573
- #### List user calendars
637
+ ==== List user calendars
574
638
 
575
639
  To retrieve the list of calendars accessible to the current user,
576
640
 
577
- ```ruby
641
+ [source,ruby]
642
+ ----
578
643
  Ribose::Calendar.all
579
- ```
644
+ ----
580
645
 
581
- #### Fetch a calendar events
646
+ ==== Fetch a calendar events
582
647
 
583
- ```ruby
648
+ [source,ruby]
649
+ ----
584
650
  Ribose::Calendar.fetch(calendar_ids, start: Data.today, length: 7)
585
- ```
651
+ ----
586
652
 
587
- #### Create a calendar
653
+ ==== Create a calendar
588
654
 
589
- ```ruby
655
+ [source,ruby]
656
+ ----
590
657
  Ribose::Calendar.create(
591
658
  owner_type: "User",
592
659
  owner_id: "The Owner UUID",
593
660
  name: "The name for the calendar",
594
661
  )
595
- ```
662
+ ----
596
663
 
597
- #### Delete a calendar
664
+ ==== Delete a calendar
598
665
 
599
- ```ruby
666
+ [source,ruby]
667
+ ----
600
668
  Ribose::Calendar.delete(calendar_id)
601
- ```
669
+ ----
602
670
 
603
- ### Event
671
+ === Event
604
672
 
605
- #### List calendar events
673
+ ==== List calendar events
606
674
 
607
- ```ruby
675
+ [source,ruby]
676
+ ----
608
677
  Ribose::Event.all(calendar_id)
609
- ```
678
+ ----
610
679
 
611
- #### Fetch a calendar event
680
+ ==== Fetch a calendar event
612
681
 
613
- ```ruby
682
+ [source,ruby]
683
+ ----
614
684
  Ribose::Event.fetch(calendar_id, event_id)
615
- ```
685
+ ----
616
686
 
617
- #### Create a calendar event
687
+ ==== Create a calendar event
618
688
 
619
- ```ruby
689
+ [source,ruby]
690
+ ----
620
691
  Ribose::Event.create(
621
692
  calendar_id,
622
693
  name: "Sample Event",
@@ -631,137 +702,141 @@ Ribose::Event.create(
631
702
  description: "Sample event",
632
703
  all_day: false,
633
704
  )
634
- ```
705
+ ----
635
706
 
636
- #### Update a calendar event
707
+ ==== Update a calendar event
637
708
 
638
- ```ruby
709
+ [source,ruby]
710
+ ----
639
711
  Ribose::Event.update(
640
712
  calendar_id, event_id, new_attributes_hash, options_params
641
713
  )
642
- ```
714
+ ----
643
715
 
644
- #### Delete a calendar event
716
+ ==== Delete a calendar event
645
717
 
646
- ```ruby
718
+ [source,ruby]
719
+ ----
647
720
  Ribose::Event.delete(calendar_id, event_id)
648
- ```
721
+ ----
649
722
 
650
- ### User
723
+ === User
651
724
 
652
- #### Create a signup request
725
+ ==== Create a signup request
653
726
 
654
- ```ruby
727
+ [source,ruby]
728
+ ----
655
729
  Ribose::User.create(email: "user@example.com", **other_attributes)
656
- ```
730
+ ----
657
731
 
658
- #### Activate a signup request
732
+ ==== Activate a signup request
659
733
 
660
- ```ruby
734
+ [source,ruby]
735
+ ----
661
736
  Ribose::User.activate(
662
737
  email: "user@example.com",
663
738
  password: "ASecureUserPassword",
664
739
  otp: "OTP Recived via the Email",
665
740
  )
666
- ```
741
+ ----
667
742
 
668
- ### Wikis
743
+ === Wikis
669
744
 
670
- #### List wiki pages
745
+ ==== List wiki pages
671
746
 
672
- ```ruby
747
+ [source,ruby]
748
+ ----
673
749
  Ribose::Wiki.all(space_id, options = {})
674
- ```
750
+ ----
675
751
 
676
- #### Fetch a wiki page
752
+ ==== Fetch a wiki page
677
753
 
678
- ```ruby
754
+ [source,ruby]
755
+ ----
679
756
  Ribose::Wiki.fetch(space_id, wiki_id, options = {})
680
- ```
757
+ ----
681
758
 
682
- #### Create a wiki page
759
+ ==== Create a wiki page
683
760
 
684
- ```ruby
761
+ [source,ruby]
762
+ ----
685
763
  Ribose::Wiki.create(
686
764
  space_id, name: "Wiki Name", tag_list: "sample", **other_attributes_hash
687
765
  )
688
- ```
766
+ ----
689
767
 
690
- #### Update a wiki page
768
+ ==== Update a wiki page
691
769
 
692
- ```ruby
770
+ [source,ruby]
771
+ ----
693
772
  Ribose::Wiki.update(
694
773
  space_id, wiki_id, **updated_attributes_hash
695
774
  )
696
- ```
775
+ ----
697
776
 
698
- #### Remove a wiki page
777
+ ==== Remove a wiki page
699
778
 
700
- ```ruby
779
+ [source,ruby]
780
+ ----
701
781
  Ribose::Wiki.delete(space_id, wiki_id)
702
- ```
782
+ ----
703
783
 
704
- ### Space categories
784
+ === Space categories
705
785
 
706
- #### List space categories
786
+ ==== List space categories
707
787
 
708
- ```ruby
788
+ [source,ruby]
789
+ ----
709
790
  Ribose::SpaceCategory.all
710
- ```
791
+ ----
711
792
 
712
- ## Development
793
+ == Development
713
794
 
714
- We are following Sandi Metz's Rules for this gem, you can read the
715
- [description of the rules here][sandi-metz] All new code should follow these
716
- rules. If you make changes in a pre-existing file that violates these rules you
717
- should fix the violations as part of your contribution.
795
+ We are following Sandi Metz's Rules for this gem, you can read the http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers[description of the rules here] All new code should follow these rules.
796
+ If you make changes in a pre-existing file that violates these rules you should fix the violations as part of your contribution.
718
797
 
719
- ### Setup
798
+ === Setup
720
799
 
721
800
  Clone the repository.
722
801
 
723
- ```sh
802
+ [source,sh]
803
+ ----
724
804
  git clone https://github.com/riboseinc/ribose-ruby
725
- ```
805
+ ----
726
806
 
727
807
  Setup your environment.
728
808
 
729
- ```sh
809
+ [source,sh]
810
+ ----
730
811
  bin/setup
731
- ```
812
+ ----
732
813
 
733
814
  Run the test suite
734
815
 
735
- ```sh
816
+ [source,sh]
817
+ ----
736
818
  bin/rspec
737
- ```
819
+ ----
738
820
 
739
- ## Contributing
821
+ == Contributing
740
822
 
741
- First, thank you for contributing! We love pull requests from everyone. By
742
- participating in this project, you hereby grant [Ribose Inc.][riboseinc] the
743
- right to grant or transfer an unlimited number of non exclusive licenses or
744
- sub-licenses to third parties, under the copyright covering the contribution
745
- to use the contribution by all means.
823
+ First, thank you for contributing!
824
+ We love pull requests from everyone.
825
+ By participating in this project, you hereby grant https://www.ribose.com[Ribose Inc.] the right to grant or transfer an unlimited number of non exclusive licenses or sub-licenses to third parties, under the copyright covering the contribution to use the contribution by all means.
746
826
 
747
827
  Here are a few technical guidelines to follow:
748
828
 
749
- 1. Open an [issue][issues] to discuss a new feature.
750
- 1. Write tests to support your new feature.
751
- 1. Make sure the entire test suite passes locally and on CI.
752
- 1. Open a Pull Request.
753
- 1. [Squash your commits][squash] after receiving feedback.
754
- 1. Party!
755
-
756
- ## Credits
829
+ . Open an https://github.com/riboseinc/ribose-ruby/issues[issue] to discuss a new feature.
830
+ . Write tests to support your new feature.
831
+ . Make sure the entire test suite passes locally and on CI.
832
+ . Open a Pull Request.
833
+ . https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature[Squash your commits] after receiving feedback.
834
+ . Party!
757
835
 
758
- This gem is developed, maintained and funded by [Ribose Inc.][riboseinc]
836
+ == Credits
759
837
 
760
- ## License
838
+ This gem is developed, maintained and funded by https://www.ribose.com[Ribose Inc.]
761
839
 
762
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
840
+ == License
763
841
 
764
- [riboseinc]: https://www.ribose.com
765
- [issues]: https://github.com/riboseinc/ribose-ruby/issues
766
- [squash]: https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature
767
- [sandi-metz]: http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers
842
+ The gem is available as open source under the terms of the http://opensource.org/licenses/MIT[MIT License].