class Etwin::Auth::GuestAuthContext

Guest authentication context

Attributes

scope[R]

Public Class Methods

deserialize(raw) click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 64
def deserialize(raw)
  scope = AuthScope.deserialize(raw['scope'])
  new(scope)
end
from_json(json_str) click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 59
def from_json(json_str)
  deserialize JSON.parse(json_str)
end
new(scope) click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 17
def initialize(scope)
  @scope = T.let(scope, AuthScope)
  freeze
end

Public Instance Methods

==(other) click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 23
def ==(other)
  case other
  when GuestAuthContext
    @scope == other.scope
  else
    false
  end
end
as_json() click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 44
def as_json
  {
    'scope' => @scope.serialize
  }
end
hash() click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 33
def hash
  [@scope].hash
end
inspect() click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 51
def inspect
  "GuestAuthContext(scope=#{@scope.inspect})"
end
to_json(opts = nil) click to toggle source
# File lib/etwin/auth/guest_auth_context.rb, line 39
def to_json(opts = nil)
  JSON.generate(as_json, opts)
end