Class: ShopifyApiBruv::Clients::Rest::Client
- Inherits:
-
Object
- Object
- ShopifyApiBruv::Clients::Rest::Client
- Defined in:
- lib/shopify_api_bruv/clients/rest/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
- #delete(path:, body: nil, query: nil, headers: nil) ⇒ Object
- #get(path:, body: nil, query: nil, headers: nil) ⇒ Object
-
#initialize(config:) ⇒ Client
constructor
A new instance of Client.
- #post(path:, body:, query: nil, headers: nil) ⇒ Object
- #put(path:, body:, query: nil, headers: nil) ⇒ Object
Constructor Details
#initialize(config:) ⇒ Client
Returns a new instance of Client.
9 10 11 12 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 9 def initialize(config:) @config = config @http_client = HttpClient.new(config:, path: "admin/api/#{config.api_version}") end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 7 def config @config end |
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
7 8 9 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 7 def http_client @http_client end |
Instance Method Details
#delete(path:, body: nil, query: nil, headers: nil) ⇒ Object
18 19 20 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 18 def delete(path:, body: nil, query: nil, headers: nil) request(method: :delete, path:, body:, query:, headers:) end |
#get(path:, body: nil, query: nil, headers: nil) ⇒ Object
14 15 16 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 14 def get(path:, body: nil, query: nil, headers: nil) request(method: :get, path:, body:, query:, headers:) end |
#post(path:, body:, query: nil, headers: nil) ⇒ Object
26 27 28 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 26 def post(path:, body:, query: nil, headers: nil) request(method: :post, path:, body:, query:, headers:) end |
#put(path:, body:, query: nil, headers: nil) ⇒ Object
22 23 24 |
# File 'lib/shopify_api_bruv/clients/rest/client.rb', line 22 def put(path:, body:, query: nil, headers: nil) request(method: :put, path:, body:, query:, headers:) end |