Class: BeyondApi::Base
- Inherits:
-
Object
- Object
- BeyondApi::Base
- Defined in:
- lib/beyond_api/resources/base.rb
Direct Known Subclasses
Carts, Categories, CategoriesView, CheckoutSettings, Customers, NewsletterTarget, OrderSettings, Orders, PaymentMethodDefinitions, PaymentMethods, PickupOptions, ProductAttributeDefinitions, Products, ProductsView, ScriptTags, ShippingZones, Shop, Signers, Users, Variations, WebhookSubscriptions
Defined Under Namespace
Classes: InvalidSessionError
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(session) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(session) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 |
# File 'lib/beyond_api/resources/base.rb', line 9 def initialize(session) @session = session raise InvalidSessionError, "Invalid session" unless session.is_a? BeyondApi::Session raise InvalidSessionError, "Session api_url cannot be nil" if session.api_url.nil? end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
7 8 9 |
# File 'lib/beyond_api/resources/base.rb', line 7 def session @session end |