Skip to content

Commit e577eb8

Browse files
committed
stack client can be configured with required parameters
1 parent 63129b9 commit e577eb8

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

lib/contentstack.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require "contentstack/version"
2+
require "contentstack/client"
3+
24

35
module Contentstack
4-
class Api
5-
def self.content
6-
"some more content"
7-
end
8-
end
6+
# The client object is initialized with a space and a key and then used
7+
# for querying resources from this space.
8+
# See README for details
99
end

lib/contentstack/error_messages.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
module ClientErrors
3+
4+
def nil_error_for(attribute)
5+
"You must specify a valid #{attribute}"
6+
end
7+
8+
def empty_error_for(attribute:)
9+
"#{attribute.to_s} cannot be empty"
10+
end
11+
end
12+
13+
# class Client
14+
# include ClientErrors
15+
# end
16+
17+
# client = Client.new
18+
# p client.nil_error_for(:access_token)
19+

0 commit comments

Comments
 (0)