Class: StarkBank::User
- Inherits:
-
StarkBank::Utils::Resource
- Object
- 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
- #access_id ⇒ Object
-
#initialize(environment, id, private_key) ⇒ User
constructor
A new instance of User.
- #private_key ⇒ Object
Methods inherited from StarkBank::Utils::Resource
Constructor Details
#initialize(environment, id, private_key) ⇒ User
Returns a new instance of User.
10 11 12 13 14 |
# File 'lib/user/user.rb', line 10 def initialize(environment, id, private_key) 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.
9 10 11 |
# File 'lib/user/user.rb', line 9 def environment @environment end |
#pem ⇒ Object (readonly)
Returns the value of attribute pem.
9 10 11 |
# File 'lib/user/user.rb', line 9 def pem @pem end |
Instance Method Details
#access_id ⇒ Object
16 17 18 |
# File 'lib/user/user.rb', line 16 def access_id "#{self.class.name.split('::').last.downcase}/#{@id}" end |
#private_key ⇒ Object
20 21 22 |
# File 'lib/user/user.rb', line 20 def private_key EllipticCurve::PrivateKey.fromPem(@pem) end |