Class: Virgil::SDK::HighLevel::VirgilApi
- Inherits:
-
Object
- Object
- Virgil::SDK::HighLevel::VirgilApi
- Defined in:
- lib/virgil/sdk/high_level/virgil_api.rb
Defined Under Namespace
Classes: VirgilApiAccessTokenException, VirgilApiException
Instance Attribute Summary collapse
-
#cards ⇒ Object
Returns the value of attribute cards.
-
#context ⇒ Object
Returns the value of attribute context.
-
#keys ⇒ Object
Returns the value of attribute keys.
Instance Method Summary collapse
-
#initialize(access_token: nil, context: nil) ⇒ VirgilApi
constructor
A new instance of VirgilApi.
Constructor Details
#initialize(access_token: nil, context: nil) ⇒ VirgilApi
Returns a new instance of VirgilApi.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/virgil/sdk/high_level/virgil_api.rb', line 52 def initialize(access_token: nil, context: nil) if (access_token && context) raise VirgilApiAccessTokenException.new unless access_token == context.access_token end if context self.context = context else self.context = Virgil::SDK::HighLevel::VirgilContext.new(access_token: access_token) end self.keys = VirgilKeyManager.new(self.context) self.cards = VirgilCardManager.new(self.context) end |
Instance Attribute Details
#cards ⇒ Object
Returns the value of attribute cards.
38 39 40 |
# File 'lib/virgil/sdk/high_level/virgil_api.rb', line 38 def cards @cards end |
#context ⇒ Object
Returns the value of attribute context.
38 39 40 |
# File 'lib/virgil/sdk/high_level/virgil_api.rb', line 38 def context @context end |
#keys ⇒ Object
Returns the value of attribute keys.
38 39 40 |
# File 'lib/virgil/sdk/high_level/virgil_api.rb', line 38 def keys @keys end |