Sha256: 5aae364125c02b154e9f320b74fed3a2dff0696e63e2eb2ac482b95f980892e6
Contents?: true
Size: 1.37 KB
Versions: 6
Compression:
Stored size: 1.37 KB
Contents
# typed: strict # frozen_string_literal: true module DearInventory class Purchase < Resource class << self extend T::Sig # Purchases # # @param params [Hash] URL query string parameters that conform to # DearInventory::Parameters::Purchase::Index sig do params(params: T::Hash[Symbol, T.untyped]). returns(DearInventory::Response) end def index(params = {}) new.request( :get, endpoint: "index", model: DearInventory::Models::PurchasesResults, params: params ) end alias call index # Purchase # # @param params [Hash] URL query string parameters that conform to # DearInventory::Parameters::Purchase::Show sig do params(params: T::Hash[Symbol, T.untyped]). returns(DearInventory::Response) end def show(params = {}) new.request( :get, endpoint: "show", model: DearInventory::Models::Purchase, params: params ) end end private sig { params(endpoint: T.nilable(String)).returns(String) } def resource_uri(endpoint) suffix = case endpoint when "index" "/purchaselist" when "show" "/purchase" end self.class.const_get(:URI_BASE) + suffix end end end
Version data entries
6 entries across 6 versions & 1 rubygems