Skip to content

Commit 976966c

Browse files
author
Kyle Decot
committed
No need for endpoint to be a method
1 parent 9881305 commit 976966c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/kmdata.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
require "ostruct"
55

66
module KMData
7-
class << self
7+
ENDPOINT = "kmdata.osu.edu"
88

9-
def endpoint
10-
"kmdata.osu.edu"
11-
end
9+
class << self
1210

1311
def get(path, params = {})
1412
path = path_with_params("/api/#{path}.json", params)
@@ -22,7 +20,7 @@ def get(path, params = {})
2220

2321
def http
2422
@http ||= begin
25-
http = Net::HTTP.new(endpoint, 443)
23+
http = Net::HTTP.new(ENDPOINT, 443)
2624
http.use_ssl = true
2725
http
2826
end

spec/kmdata_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
describe 'endpoint' do
77
it 'returns the endpoint' do
8-
KMData.endpoint.should eq('kmdata.osu.edu')
8+
KMData::ENDPOINT.should eq('kmdata.osu.edu')
99
end
1010
end
1111

0 commit comments

Comments
 (0)