Class: StarkCore::User
- Inherits:
-
StarkCore::Utils::Resource
- Object
- StarkCore::Utils::SubResource
- StarkCore::Utils::Resource
- StarkCore::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 StarkCore::Utils::Resource
Instance Method Summary collapse
-
#initialize(environment, id, private_key) ⇒ User
constructor
A new instance of User.
- #private_key ⇒ Object
Methods inherited from StarkCore::Utils::SubResource
Constructor Details
#initialize(environment, id, private_key) ⇒ User
Returns a new instance of User.
9 10 11 12 13 |
# File 'lib/user/user.rb', line 9 def initialize(environment, id, private_key) super(id) @pem = StarkCore::Utils::Checks.check_private_key(private_key) @environment = StarkCore::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
15 16 17 |
# File 'lib/user/user.rb', line 15 def private_key return EllipticCurve::PrivateKey.fromPem(@pem) end |