Class: StoryTeller::InvocationIdentity

Inherits:
Object
  • #Object
show all
Includes:
PrivilegedIdentity
Defined in:
lib/story_teller/privileges.rb

Overview

class InvocationIdentity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime) ⇒ InvocationIdentity

Returns a new instance of InvocationIdentity.



30
31
32
# File 'lib/story_teller/privileges.rb', line 30

def initialize(runtime)
  @runtime = runtime
end

Instance Attribute Details

#runtimeObject (readonly)

Returns the value of attribute runtime.



28
29
30
# File 'lib/story_teller/privileges.rb', line 28

def runtime
  @runtime
end

Instance Method Details

#identityObject



34
35
36
# File 'lib/story_teller/privileges.rb', line 34

def identity
  "runtime:#{runtime.identity}"
end

#nameObject



42
43
44
# File 'lib/story_teller/privileges.rb', line 42

def name
  privilege_label
end

#privilege_labelObject



38
39
40
# File 'lib/story_teller/privileges.rb', line 38

def privilege_label
  'this runtime session'
end

#privileged?(privilege) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/story_teller/privileges.rb', line 46

def privileged?(privilege)
  runtime.privileged?(privilege)
end

#to_sObject



50
51
52
# File 'lib/story_teller/privileges.rb', line 50

def to_s
  privilege_label
end