Class: StarkCore::User

Inherits:
StarkCore::Utils::Resource show all
Defined in:
lib/user/user.rb

Direct Known Subclasses

Organization, Project

Instance Attribute Summary collapse

Attributes inherited from StarkCore::Utils::Resource

#id

Instance Method Summary collapse

Methods inherited from StarkCore::Utils::SubResource

#class_name, #to_s

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

#environmentObject (readonly)

Returns the value of attribute environment.



8
9
10
# File 'lib/user/user.rb', line 8

def environment
  @environment
end

#pemObject (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_keyObject



15
16
17
# File 'lib/user/user.rb', line 15

def private_key
  return EllipticCurve::PrivateKey.fromPem(@pem)
end