warb 0.1.4 → 1.0.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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -12
  3. data/README.md +9 -32
  4. data/Rakefile +3 -3
  5. data/docs/README.md +1 -4
  6. data/docs/components/README.md +1 -4
  7. data/docs/messages/README.md +1 -2
  8. data/docs/messages/flow.md +5 -241
  9. data/docs/messages/interactive_call_to_action_url.md +9 -9
  10. data/docs/messages/interactive_list.md +2 -2
  11. data/docs/messages/interactive_reply_button.md +9 -9
  12. data/docs/setup.md +1 -45
  13. data/examples/audio.rb +10 -10
  14. data/examples/document.rb +34 -34
  15. data/examples/image.rb +22 -22
  16. data/examples/interactive_call_to_action_url.rb +46 -46
  17. data/examples/interactive_list.rb +61 -61
  18. data/examples/interactive_reply_button.rb +43 -43
  19. data/examples/location.rb +32 -32
  20. data/examples/location_request.rb +11 -11
  21. data/examples/message.rb +8 -8
  22. data/examples/sticker.rb +10 -10
  23. data/examples/video.rb +22 -22
  24. data/examples/webhook.rb +43 -77
  25. data/lib/warb/client.rb +5 -7
  26. data/lib/warb/components/action.rb +8 -12
  27. data/lib/warb/configuration.rb +1 -4
  28. data/lib/warb/connection.rb +9 -15
  29. data/lib/warb/dispatcher.rb +3 -4
  30. data/lib/warb/dispatcher_concern.rb +0 -6
  31. data/lib/warb/indicator_dispatcher.rb +4 -4
  32. data/lib/warb/media_dispatcher.rb +10 -10
  33. data/lib/warb/resources/audio.rb +1 -1
  34. data/lib/warb/resources/contact.rb +20 -22
  35. data/lib/warb/resources/document.rb +1 -1
  36. data/lib/warb/resources/flow.rb +20 -82
  37. data/lib/warb/resources/image.rb +1 -1
  38. data/lib/warb/resources/interactive_call_to_action_url.rb +8 -10
  39. data/lib/warb/resources/interactive_list.rb +5 -7
  40. data/lib/warb/resources/interactive_reply_button.rb +8 -10
  41. data/lib/warb/resources/location.rb +1 -11
  42. data/lib/warb/resources/location_request.rb +3 -5
  43. data/lib/warb/resources/reaction.rb +1 -1
  44. data/lib/warb/resources/resource.rb +4 -14
  45. data/lib/warb/resources/sticker.rb +1 -1
  46. data/lib/warb/resources/text.rb +3 -31
  47. data/lib/warb/resources/video.rb +1 -1
  48. data/lib/warb/utils.rb +1 -3
  49. data/lib/warb/version.rb +1 -1
  50. data/lib/warb.rb +31 -67
  51. metadata +3 -34
  52. data/docs/components/button.md +0 -62
  53. data/docs/components/copy_code_button.md +0 -57
  54. data/docs/components/flow_button.md +0 -102
  55. data/docs/components/url_button.md +0 -57
  56. data/docs/messages/template.md +0 -373
  57. data/docs/resources/README.md +0 -14
  58. data/docs/resources/currency.md +0 -22
  59. data/docs/resources/date_time.md +0 -11
  60. data/docs/resources/text.md +0 -9
  61. data/lib/warb/category.rb +0 -8
  62. data/lib/warb/components/button.rb +0 -29
  63. data/lib/warb/components/component.rb +0 -19
  64. data/lib/warb/components/copy_code_button.rb +0 -30
  65. data/lib/warb/components/flow_button.rb +0 -32
  66. data/lib/warb/components/quick_reply_button.rb +0 -15
  67. data/lib/warb/components/url_button.rb +0 -30
  68. data/lib/warb/components/voice_call_button.rb +0 -15
  69. data/lib/warb/errors.rb +0 -27
  70. data/lib/warb/language.rb +0 -8
  71. data/lib/warb/resources/currency.rb +0 -47
  72. data/lib/warb/resources/date_time.rb +0 -34
  73. data/lib/warb/resources/helpers/header.rb +0 -35
  74. data/lib/warb/resources/template.rb +0 -163
  75. data/lib/warb/resources/validation.rb +0 -30
  76. data/lib/warb/response.rb +0 -33
  77. data/lib/warb/response_error_handler.rb +0 -42
  78. data/lib/warb/template_dispatcher.rb +0 -21
@@ -1,21 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../lib/warb'
3
+ require_relative "../lib/warb"
4
4
 
5
5
  # Configure your variables here
6
6
 
7
- access_token = ''
8
- business_id = ''
9
- sender_id = ''
10
- recipient_number = ''
7
+ access_token = ""
8
+ business_id = ""
9
+ sender_id = ""
10
+ recipient_number = ""
11
11
 
12
12
  # You can use Resources to create headers for your messages.
13
- text_header = Warb::Resources::Text.as_header('OPTIONAL - Header')
13
+ text_header = Warb::Resources::Text.as_header("OPTIONAL - Header")
14
14
  image_header = Warb::Resources::Image.as_header(media_id: image_id)
15
15
  video_header = Warb::Resources::Video.as_header(link: image_url)
16
16
 
17
17
  # You can use Action Components to create actions for your messages.
18
- action_component = Warb::Components::ReplyButtonAction.new(['button 1', 'button 2', 'button 3'])
18
+ action_component = Warb::Components::ReplyButtonAction.new(["button 1", "button 2", "button 3"])
19
19
 
20
20
  # We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
21
21
  # So you can comment out the sections you don't want to test.
@@ -33,52 +33,52 @@ end
33
33
  warb_from_setup.interactive_list.dispatch(
34
34
  recipient_number,
35
35
  header: text_header,
36
- body: 'body',
37
- footer: 'footer',
36
+ body: "body",
37
+ footer: "footer",
38
38
  action: action_component
39
39
  )
40
40
 
41
41
  warb_from_setup.interactive_list.dispatch(
42
42
  recipient_number,
43
43
  header: image_header,
44
- body: 'body',
45
- footer: 'footer',
44
+ body: "body",
45
+ footer: "footer",
46
46
  action: action_component
47
47
  )
48
48
 
49
49
  warb_from_setup.interactive_list.dispatch(
50
50
  recipient_number,
51
51
  header: video_header,
52
- body: 'body',
53
- footer: 'footer',
52
+ body: "body",
53
+ footer: "footer",
54
54
  action: action_component
55
55
  )
56
56
 
57
57
  warb_from_setup.interactive_list.dispatch(recipient_number) do |builder|
58
58
  # OPTIONAL Headers: you can choose between text, image, or video headers.
59
59
 
60
- builder.add_text_header('Text Header')
60
+ builder.set_text_header("Text Header")
61
61
 
62
62
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
63
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
63
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
64
64
 
65
65
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
66
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
66
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
67
67
 
68
- builder.body = 'body'
69
- builder.footer = 'footer'
68
+ builder.body = "body"
69
+ builder.footer = "footer"
70
70
 
71
71
  builder.build_action do |action|
72
- action.button_text = 'Action button text'
72
+ action.button_text = "Action button text"
73
73
 
74
74
  section = action.add_section
75
- section.title = 'Title'
76
- section.rows = [Warb::Components::Row.new(title: 'S #0 R #0')]
77
- section.add_row title: 'Second Row', description: 'Who knows?'
75
+ section.title = "Title"
76
+ section.rows = [Warb::Components::Row.new(title: "S #0 R #0")]
77
+ section.add_row title: "Second Row", description: "Who knows?"
78
78
 
79
- section = action.add_section title: 'Second Section'
80
- row = section.add_row title: 'KeK'
81
- row.description = 'Description'
79
+ section = action.add_section title: "Second Section"
80
+ row = section.add_row title: "KeK"
81
+ row.description = "Description"
82
82
  end
83
83
  end
84
84
 
@@ -95,52 +95,52 @@ warb_from_new = Warb.new(
95
95
  warb_from_new.interactive_list.dispatch(
96
96
  recipient_number,
97
97
  header: text_header,
98
- body: 'body',
99
- footer: 'footer',
98
+ body: "body",
99
+ footer: "footer",
100
100
  action: action_component
101
101
  )
102
102
 
103
103
  warb_from_new.interactive_list.dispatch(
104
104
  recipient_number,
105
105
  header: image_header,
106
- body: 'body',
107
- footer: 'footer',
106
+ body: "body",
107
+ footer: "footer",
108
108
  action: action_component
109
109
  )
110
110
 
111
111
  warb_from_new.interactive_list.dispatch(
112
112
  recipient_number,
113
113
  header: video_header,
114
- body: 'body',
115
- footer: 'footer',
114
+ body: "body",
115
+ footer: "footer",
116
116
  action: action_component
117
117
  )
118
118
 
119
119
  warb_from_new.interactive_list.dispatch(recipient_number) do |builder|
120
120
  # OPTIONAL Headers: you can choose between text, image, or video headers.
121
121
 
122
- builder.add_text_header('Text Header')
122
+ builder.set_text_header("Text Header")
123
123
 
124
124
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
125
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
125
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
126
126
 
127
127
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
128
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
128
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
129
129
 
130
- builder.body = 'body'
131
- builder.footer = 'footer'
130
+ builder.body = "body"
131
+ builder.footer = "footer"
132
132
 
133
133
  builder.build_action do |action|
134
- action.button_text = 'Action button text'
134
+ action.button_text = "Action button text"
135
135
 
136
136
  section = action.add_section
137
- section.title = 'Title'
138
- section.rows = [Warb::Components::Row.new(title: 'S #0 R #0')]
139
- section.add_row title: 'Second Row', description: 'Who knows?'
137
+ section.title = "Title"
138
+ section.rows = [Warb::Components::Row.new(title: "S #0 R #0")]
139
+ section.add_row title: "Second Row", description: "Who knows?"
140
140
 
141
- section = action.add_section title: 'Second Section'
142
- row = section.add_row title: 'KeK'
143
- row.description = 'Description'
141
+ section = action.add_section title: "Second Section"
142
+ row = section.add_row title: "KeK"
143
+ row.description = "Description"
144
144
  end
145
145
  end
146
146
 
@@ -151,51 +151,51 @@ end
151
151
  Warb.interactive_list.dispatch(
152
152
  recipient_number,
153
153
  header: text_header,
154
- body: 'body',
155
- footer: 'footer',
154
+ body: "body",
155
+ footer: "footer",
156
156
  action: action_component
157
157
  )
158
158
 
159
159
  Warb.interactive_list.dispatch(
160
160
  recipient_number,
161
161
  header: image_header,
162
- body: 'body',
163
- footer: 'footer',
162
+ body: "body",
163
+ footer: "footer",
164
164
  action: action_component
165
165
  )
166
166
 
167
167
  Warb.interactive_list.dispatch(
168
168
  recipient_number,
169
169
  header: video_header,
170
- body: 'body',
171
- footer: 'footer',
170
+ body: "body",
171
+ footer: "footer",
172
172
  action: action_component
173
173
  )
174
174
 
175
175
  Warb.interactive_list.dispatch(recipient_number) do |builder|
176
176
  # OPTIONAL Headers: you can choose between text, image, or video headers.
177
177
 
178
- builder.add_text_header('Text Header')
178
+ builder.set_text_header("Text Header")
179
179
 
180
180
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
181
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
181
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
182
182
 
183
183
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
184
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
184
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
185
185
 
186
- builder.body = 'body'
187
- builder.footer = 'footer'
186
+ builder.body = "body"
187
+ builder.footer = "footer"
188
188
 
189
189
  builder.build_action do |action|
190
- action.button_text = 'Action button text'
190
+ action.button_text = "Action button text"
191
191
 
192
192
  section = action.add_section
193
- section.title = 'Title'
194
- section.rows = [Warb::Components::Row.new(title: 'S #0 R #0')]
195
- section.add_row title: 'Second Row', description: 'Who knows?'
193
+ section.title = "Title"
194
+ section.rows = [Warb::Components::Row.new(title: "S #0 R #0")]
195
+ section.add_row title: "Second Row", description: "Who knows?"
196
196
 
197
- section = action.add_section title: 'Second Section'
198
- row = section.add_row title: 'KeK'
199
- row.description = 'Description'
197
+ section = action.add_section title: "Second Section"
198
+ row = section.add_row title: "KeK"
199
+ row.description = "Description"
200
200
  end
201
201
  end
@@ -1,21 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../lib/warb'
3
+ require_relative "../lib/warb"
4
4
 
5
5
  # Configure your variables here
6
6
 
7
- access_token = ''
8
- business_id = ''
9
- sender_id = ''
10
- recipient_number = ''
7
+ access_token = ""
8
+ business_id = ""
9
+ sender_id = ""
10
+ recipient_number = ""
11
11
 
12
12
  # You can use Resources to create headers for your messages.
13
- text_header = Warb::Resources::Text.as_header('OPTIONAL - Header')
13
+ text_header = Warb::Resources::Text.as_header("OPTIONAL - Header")
14
14
  image_header = Warb::Resources::Image.as_header(media_id: image_id)
15
15
  video_header = Warb::Resources::Video.as_header(link: image_url)
16
16
 
17
17
  # You can use Action Components to create actions for your messages.
18
- action_component = Warb::Components::ReplyButtonAction.new(['button 1', 'button 2', 'button 3'])
18
+ action_component = Warb::Components::ReplyButtonAction.new(["button 1", "button 2", "button 3"])
19
19
 
20
20
  # We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
21
21
  # So you can comment out the sections you don't want to test.
@@ -33,43 +33,43 @@ end
33
33
  warb_from_setup.interactive_reply_button.dispatch(
34
34
  recipient_number,
35
35
  header: text_header,
36
- body: 'body',
37
- footer: 'footer',
36
+ body: "body",
37
+ footer: "footer",
38
38
  action: action_component
39
39
  )
40
40
 
41
41
  warb_from_setup.interactive_reply_button.dispatch(
42
42
  recipient_number,
43
43
  header: image_header,
44
- body: 'body',
45
- footer: 'footer',
44
+ body: "body",
45
+ footer: "footer",
46
46
  action: action_component
47
47
  )
48
48
 
49
49
  warb_from_setup.interactive_reply_button.dispatch(
50
50
  recipient_number,
51
51
  header: video_header,
52
- body: 'body',
53
- footer: 'footer',
52
+ body: "body",
53
+ footer: "footer",
54
54
  action: action_component
55
55
  )
56
56
 
57
57
  warb_from_setup.interactive_reply_button.dispatch(recipient_number) do |builder|
58
58
  # OPTIONAL Headers: you can choose between text, image, or video headers.
59
59
 
60
- builder.add_text_header('Text Header')
60
+ builder.set_text_header("Text Header")
61
61
 
62
62
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
63
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
63
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
64
64
 
65
65
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
66
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
66
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
67
67
 
68
- builder.body = 'body'
69
- builder.footer = 'footer'
68
+ builder.body = "body"
69
+ builder.footer = "footer"
70
70
 
71
71
  builder.build_action do |action|
72
- action.buttons_texts = ['button 1', 'button 2', 'button 3']
72
+ action.buttons_texts = ["button 1", "button 2", "button 3"]
73
73
  end
74
74
  end
75
75
 
@@ -86,43 +86,43 @@ warb_from_new = Warb.new(
86
86
  warb_from_new.interactive_reply_button.dispatch(
87
87
  recipient_number,
88
88
  header: text_header,
89
- body: 'body',
90
- footer: 'footer',
89
+ body: "body",
90
+ footer: "footer",
91
91
  action: action_component
92
92
  )
93
93
 
94
94
  warb_from_new.interactive_reply_button.dispatch(
95
95
  recipient_number,
96
96
  header: image_header,
97
- body: 'body',
98
- footer: 'footer',
97
+ body: "body",
98
+ footer: "footer",
99
99
  action: action_component
100
100
  )
101
101
 
102
102
  warb_from_new.interactive_reply_button.dispatch(
103
103
  recipient_number,
104
104
  header: video_header,
105
- body: 'body',
106
- footer: 'footer',
105
+ body: "body",
106
+ footer: "footer",
107
107
  action: action_component
108
108
  )
109
109
 
110
110
  warb_from_new.interactive_reply_button.dispatch(recipient_number) do |builder|
111
111
  # OPTIONAL Headers: you can choose between text, image, or video headers.
112
112
 
113
- builder.add_text_header('Text Header')
113
+ builder.set_text_header("Text Header")
114
114
 
115
115
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
116
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
116
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
117
117
 
118
118
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
119
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
119
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
120
120
 
121
- builder.body = 'body'
122
- builder.footer = 'footer'
121
+ builder.body = "body"
122
+ builder.footer = "footer"
123
123
 
124
124
  builder.build_action do |action|
125
- action.buttons_texts = ['button 1', 'button 2', 'button 3']
125
+ action.buttons_texts = ["button 1", "button 2", "button 3"]
126
126
  end
127
127
  end
128
128
 
@@ -133,42 +133,42 @@ end
133
133
  Warb.interactive_reply_button.dispatch(
134
134
  recipient_number,
135
135
  header: text_header,
136
- body: 'body',
137
- footer: 'footer',
136
+ body: "body",
137
+ footer: "footer",
138
138
  action: action_component
139
139
  )
140
140
 
141
141
  Warb.interactive_reply_button.dispatch(
142
142
  recipient_number,
143
143
  header: image_header,
144
- body: 'body',
145
- footer: 'footer',
144
+ body: "body",
145
+ footer: "footer",
146
146
  action: action_component
147
147
  )
148
148
 
149
149
  Warb.interactive_reply_button.dispatch(
150
150
  recipient_number,
151
151
  header: video_header,
152
- body: 'body',
153
- footer: 'footer',
152
+ body: "body",
153
+ footer: "footer",
154
154
  action: action_component
155
155
  )
156
156
 
157
157
  Warb.interactive_reply_button.dispatch(recipient_number) do |builder|
158
158
  # OPTIONAL Headers: you can choose between text, image, or video headers.
159
159
 
160
- builder.add_text_header('Text Header')
160
+ builder.set_text_header("Text Header")
161
161
 
162
162
  # If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
163
- # builder.add_image_header(media_id: image_id) # or builder.add_image_header(link: image_link)
163
+ # builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
164
164
 
165
165
  # If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
166
- # builder.add_video_header(media_id: video_id) # or builder.add_video_header(link: video_link)
166
+ # builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
167
167
 
168
- builder.body = 'body'
169
- builder.footer = 'footer'
168
+ builder.body = "body"
169
+ builder.footer = "footer"
170
170
 
171
171
  builder.build_action do |action|
172
- action.buttons_texts = ['button 1', 'button 2', 'button 3']
172
+ action.buttons_texts = ["button 1", "button 2", "button 3"]
173
173
  end
174
174
  end
data/examples/location.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../lib/warb'
3
+ require_relative "../lib/warb"
4
4
 
5
5
  # Configure your variables here
6
6
 
7
- access_token = ''
8
- business_id = ''
9
- sender_id = ''
10
- recipient_number = ''
7
+ access_token = ""
8
+ business_id = ""
9
+ sender_id = ""
10
+ recipient_number = ""
11
11
 
12
12
  # We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
13
13
  # So you can comment out the sections you don't want to test.
@@ -22,20 +22,20 @@ warb_from_setup = Warb.setup do |config|
22
22
  config.sender_id = sender_id
23
23
  end
24
24
 
25
- warb_from_setup.location.dispatch(recipient_number, latitude: '37.44216251868683', longitude: '-122.16153582049394')
25
+ warb_from_setup.location.dispatch(recipient_number, latitude: "37.44216251868683", longitude: "-122.16153582049394")
26
26
  warb_from_setup.location.dispatch(
27
27
  recipient_number,
28
- latitude: '37.44216251868683',
29
- longitude: '-122.16153582049394',
30
- name: 'OPTIONAL - Location Name',
31
- address: 'OPTIONAL - Location Address'
28
+ latitude: "37.44216251868683",
29
+ longitude: "-122.16153582049394",
30
+ name: "OPTIONAL - Location Name",
31
+ address: "OPTIONAL - Location Address"
32
32
  )
33
33
 
34
34
  warb_from_setup.location.dispatch(recipient_number) do |builder|
35
- builder.latitude = '37.44216251868683'
36
- builder.longitude = '-122.16153582049394'
37
- builder.name = 'OPTIONAL - Location Name'
38
- builder.address = 'OPTIONAL - Location Address'
35
+ builder.latitude = "37.44216251868683"
36
+ builder.longitude = "-122.16153582049394"
37
+ builder.name = "OPTIONAL - Location Name"
38
+ builder.address = "OPTIONAL - Location Address"
39
39
  end
40
40
 
41
41
  # ############################################ #
@@ -48,38 +48,38 @@ warb_from_new = Warb.new(
48
48
  sender_id: sender_id
49
49
  )
50
50
 
51
- warb_from_new.location.dispatch(recipient_number, latitude: '37.44216251868683', longitude: '-122.16153582049394')
51
+ warb_from_new.location.dispatch(recipient_number, latitude: "37.44216251868683", longitude: "-122.16153582049394")
52
52
  warb_from_new.location.dispatch(
53
53
  recipient_number,
54
- latitude: '37.44216251868683',
55
- longitude: '-122.16153582049394',
56
- name: 'OPTIONAL - Location Name',
57
- address: 'OPTIONAL - Location Address'
54
+ latitude: "37.44216251868683",
55
+ longitude: "-122.16153582049394",
56
+ name: "OPTIONAL - Location Name",
57
+ address: "OPTIONAL - Location Address"
58
58
  )
59
59
 
60
60
  warb_from_new.location.dispatch(recipient_number) do |builder|
61
- builder.latitude = '37.44216251868683'
62
- builder.longitude = '-122.16153582049394'
63
- builder.name = 'OPTIONAL - Location Name'
64
- builder.address = 'OPTIONAL - Location Address'
61
+ builder.latitude = "37.44216251868683"
62
+ builder.longitude = "-122.16153582049394"
63
+ builder.name = "OPTIONAL - Location Name"
64
+ builder.address = "OPTIONAL - Location Address"
65
65
  end
66
66
 
67
67
  # ################################################# #
68
68
  # ============== Using Warb directly ============== #
69
69
  # ################################################# #
70
70
 
71
- Warb.location.dispatch(recipient_number, latitude: '37.44216251868683', longitude: '-122.16153582049394')
71
+ Warb.location.dispatch(recipient_number, latitude: "37.44216251868683", longitude: "-122.16153582049394")
72
72
  Warb.location.dispatch(
73
73
  recipient_number,
74
- latitude: '37.44216251868683',
75
- longitude: '-122.16153582049394',
76
- name: 'OPTIONAL - Location Name',
77
- address: 'OPTIONAL - Location Address'
74
+ latitude: "37.44216251868683",
75
+ longitude: "-122.16153582049394",
76
+ name: "OPTIONAL - Location Name",
77
+ address: "OPTIONAL - Location Address"
78
78
  )
79
79
 
80
80
  Warb.location.dispatch(recipient_number) do |builder|
81
- builder.latitude = '37.44216251868683'
82
- builder.longitude = '-122.16153582049394'
83
- builder.name = 'OPTIONAL - Location Name'
84
- builder.address = 'OPTIONAL - Location Address'
81
+ builder.latitude = "37.44216251868683"
82
+ builder.longitude = "-122.16153582049394"
83
+ builder.name = "OPTIONAL - Location Name"
84
+ builder.address = "OPTIONAL - Location Address"
85
85
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../lib/warb'
3
+ require_relative "../lib/warb"
4
4
 
5
5
  # Configure your variables here
6
6
 
7
- access_token = ''
8
- business_id = ''
9
- sender_id = ''
10
- recipient_number = ''
7
+ access_token = ""
8
+ business_id = ""
9
+ sender_id = ""
10
+ recipient_number = ""
11
11
 
12
12
  # We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
13
13
  # So you can comment out the sections you don't want to test.
@@ -22,10 +22,10 @@ warb_from_setup = Warb.setup do |config|
22
22
  config.sender_id = sender_id
23
23
  end
24
24
 
25
- warb_from_setup.location_request.dispatch(recipient_number, body_text: 'Location request body text')
25
+ warb_from_setup.location_request.dispatch(recipient_number, body_text: "Location request body text")
26
26
 
27
27
  warb_from_setup.location_request.dispatch(recipient_number) do |builder|
28
- builder.body_text = 'Location request body text'
28
+ builder.body_text = "Location request body text"
29
29
  end
30
30
 
31
31
  # ############################################ #
@@ -38,18 +38,18 @@ warb_from_new = Warb.new(
38
38
  sender_id: sender_id
39
39
  )
40
40
 
41
- warb_from_new.location_request.dispatch(recipient_number, body_text: 'Location request body text')
41
+ warb_from_new.location_request.dispatch(recipient_number, body_text: "Location request body text")
42
42
 
43
43
  warb_from_new.location_request.dispatch(recipient_number) do |builder|
44
- builder.body_text = 'Location request body text'
44
+ builder.body_text = "Location request body text"
45
45
  end
46
46
 
47
47
  # ################################################# #
48
48
  # ============== Using Warb directly ============== #
49
49
  # ################################################# #
50
50
 
51
- Warb.location_request.dispatch(recipient_number, body_text: 'Location request body text')
51
+ Warb.location_request.dispatch(recipient_number, body_text: "Location request body text")
52
52
 
53
53
  Warb.location_request.dispatch(recipient_number) do |builder|
54
- builder.body_text = 'Location request body text'
54
+ builder.body_text = "Location request body text"
55
55
  end
data/examples/message.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../lib/warb'
3
+ require_relative "../lib/warb"
4
4
 
5
5
  # Configure your variables here
6
6
 
7
- access_token = ''
8
- business_id = ''
9
- sender_id = ''
10
- recipient_number = ''
7
+ access_token = ""
8
+ business_id = ""
9
+ sender_id = ""
10
+ recipient_number = ""
11
11
 
12
12
  # We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
13
13
  # So you can comment out the sections you don't want to test.
@@ -27,7 +27,7 @@ warb_from_setup.message.dispatch(recipient_number, message: 'Hello from warb! Me
27
27
  warb_from_setup.message.dispatch(recipient_number, text: 'Hello from warb! Message sent with "text" key')
28
28
 
29
29
  warb_from_setup.message.dispatch(recipient_number) do |builder|
30
- builder.content = 'Hello from warb! Message sent with block builder'
30
+ builder.content = "Hello from warb! Message sent with block builder"
31
31
  end
32
32
 
33
33
  # ############################################ #
@@ -45,7 +45,7 @@ warb_from_new.message.dispatch(recipient_number, message: 'Hello from warb! Mess
45
45
  warb_from_new.message.dispatch(recipient_number, text: 'Hello from warb! Message sent with "text" key')
46
46
 
47
47
  warb_from_new.message.dispatch(recipient_number) do |builder|
48
- builder.content = 'Hello from warb! Message sent with block builder'
48
+ builder.content = "Hello from warb! Message sent with block builder"
49
49
  end
50
50
 
51
51
  # ################################################# #
@@ -57,5 +57,5 @@ Warb.message.dispatch(recipient_number, message: 'Hello from warb! Message sent
57
57
  Warb.message.dispatch(recipient_number, text: 'Hello from warb! Message sent with "text" key')
58
58
 
59
59
  Warb.message.dispatch(recipient_number) do |builder|
60
- builder.content = 'Hello from warb! Message sent with block builder'
60
+ builder.content = "Hello from warb! Message sent with block builder"
61
61
  end