Class: EPlat::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/e_plat/session.rb

Instance Method Summary collapse

Constructor Details

#initialize(platform:, store_url:, api_token:, store_hash: nil) ⇒ Session

the session is an instance of EPlat::Client made available via Rails Current::Attributes



6
7
8
9
10
11
12
13
14
# File 'lib/e_plat/session.rb', line 6

def initialize(platform:, store_url:, api_token:, store_hash: nil)
  Current.e_plat_session         = EPlat::Client.new
  Current.e_plat_session.platform   = platform
  Current.e_plat_session.store_url  = store_url
  Current.e_plat_session.api_token  = api_token
  Current.e_plat_session.store_hash = store_hash
  
  Current.e_plat_session.send(:get_api_version) if Current.e_plat_session.active?
end