Class: BeyondApi::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/beyond_api/resources/base.rb

Defined Under Namespace

Classes: InvalidSessionError

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sessionObject (readonly)

Returns the value of attribute session.



7
8
9
# File 'lib/beyond_api/resources/base.rb', line 7

def session
  @session
end