Class: StarkBank::User
- Inherits:
-
StarkBank::Utils::Resource
- Object
- StarkBank::Utils::SubResource
- StarkBank::Utils::Resource
- StarkBank::User
- Defined in:
- lib/user/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#pem ⇒ Object
readonly
Returns the value of attribute pem.
Attributes inherited from StarkBank::Utils::Resource
Instance Method Summary collapse
-
#initialize(environment, id, private_key) ⇒ User
constructor
A new instance of User.
- #private_key ⇒ Object
Methods inherited from StarkBank::Utils::SubResource
Constructor Details
#initialize(environment, id, private_key) ⇒ User
Returns a new instance of User.
9 10 11 12 13 14 |
# File 'lib/user/user.rb', line 9 def initialize(environment, id, private_key) require_relative('../utils/checks') super(id) @pem = StarkBank::Utils::Checks.check_private_key(private_key) @environment = StarkBank::Utils::Checks.check_environment(environment) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
8 9 10 |
# File 'lib/user/user.rb', line 8 def environment @environment end |
#pem ⇒ Object (readonly)
Returns the value of attribute pem.
8 9 10 |
# File 'lib/user/user.rb', line 8 def pem @pem end |
Instance Method Details
#private_key ⇒ Object
16 17 18 |
# File 'lib/user/user.rb', line 16 def private_key EllipticCurve::PrivateKey.fromPem(@pem) end |