Class: FiberAudit::Runtime::Session

Inherits:
Data
  • Object
show all
Defined in:
lib/fiber_audit/runtime/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, started_at:, started_monotonic_ns:, policy: Policy.new, tool_version: FiberAudit::VERSION, ruby_version: RUBY_VERSION) ⇒ Session

Returns a new instance of Session.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fiber_audit/runtime/session.rb', line 17

def initialize(
  id:,
  started_at:,
  started_monotonic_ns:,
  policy: Policy.new,
  tool_version: FiberAudit::VERSION,
  ruby_version: RUBY_VERSION
)
  super(
    id: normalize_id(id),
    started_at: Validation.utc_time(started_at, 'started_at'),
    started_monotonic_ns: Validation.integer(started_monotonic_ns, 'started_monotonic_ns'),
    policy: normalize_policy(policy),
    tool_version: Validation.string(tool_version, 'tool_version', max_bytes: 64),
    ruby_version: Validation.string(ruby_version, 'ruby_version', max_bytes: 64)
  )
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def id
  @id
end

#policyObject (readonly)

Returns the value of attribute policy

Returns:

  • (Object)

    the current value of policy



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def policy
  @policy
end

#ruby_versionObject (readonly)

Returns the value of attribute ruby_version

Returns:

  • (Object)

    the current value of ruby_version



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def ruby_version
  @ruby_version
end

#started_atObject (readonly)

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def started_at
  @started_at
end

#started_monotonic_nsObject (readonly)

Returns the value of attribute started_monotonic_ns

Returns:

  • (Object)

    the current value of started_monotonic_ns



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def started_monotonic_ns
  @started_monotonic_ns
end

#tool_versionObject (readonly)

Returns the value of attribute tool_version

Returns:

  • (Object)

    the current value of tool_version



9
10
11
# File 'lib/fiber_audit/runtime/session.rb', line 9

def tool_version
  @tool_version
end