Skip to content

Commit cdbcb7a

Browse files
author
Tom Kemp
committed
Use snake_case
1 parent 7e0c5d3 commit cdbcb7a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ channels_client = Pusher::Client.new(
3232
key: 'your-app-key',
3333
secret: 'your-app-secret',
3434
cluster: 'your-app-cluster',
35-
useTLS: true
35+
use_tls: true
3636
)
3737
```
3838

39-
The `cluster` value will set the `host` to `api-<cluster>.pusher.com`. The `useTLS` value is optional and defaults to `false`. It will set the `scheme` and `port`. Custom `scheme` and `port` values take precendence over `useTLS`.
39+
The `cluster` value will set the `host` to `api-<cluster>.pusher.com`. The `use_tls` value is optional and defaults to `false`. It will set the `scheme` and `port`. Custom `scheme` and `port` values take precendence over `use_tls`.
4040

4141
If you want to set a custom `host` value for your client then you can do so when instantiating a Pusher Channels client like so:
4242

lib/pusher/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize(options = {})
2828
:port => 80,
2929
}
3030

31-
if options[:useTLS] || options[:encrypted]
31+
if options[:use_tls] || options[:encrypted]
3232
default_options[:scheme] = "https"
3333
default_options[:port] = 443
3434
end

spec/client_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
end
102102

103103
describe 'configuring TLS' do
104-
it 'should set port and scheme if "useTLS" enabled' do
104+
it 'should set port and scheme if "use_tls" enabled' do
105105
client = Pusher::Client.new({
106-
:useTLS => true,
106+
:use_tls => true,
107107
})
108108
expect(client.scheme).to eq('https')
109109
expect(client.port).to eq(443)
@@ -117,15 +117,15 @@
117117
expect(client.port).to eq(443)
118118
end
119119

120-
it 'should use non-TLS port and scheme if "encrypted" or "useTLS" are not set' do
120+
it 'should use non-TLS port and scheme if "encrypted" or "use_tls" are not set' do
121121
client = Pusher::Client.new
122122
expect(client.scheme).to eq('http')
123123
expect(client.port).to eq(80)
124124
end
125125

126-
it 'should override port if "useTLS" option set but a different port is specified' do
126+
it 'should override port if "use_tls" option set but a different port is specified' do
127127
client = Pusher::Client.new({
128-
:useTLS => true,
128+
:use_tls => true,
129129
:port => 8443
130130
})
131131
expect(client.scheme).to eq('https')

0 commit comments

Comments
 (0)