Class: SSO::Client::Passport

Inherits:
Object
  • Object
show all
Defined in:
lib/sso/client/passport.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, secret:, state:, user:, chip: nil) ⇒ Passport

Returns a new instance of Passport.



8
9
10
11
12
13
14
# File 'lib/sso/client/passport.rb', line 8

def initialize(id:, secret:, state:, user:, chip: nil)
  @id     = id
  @secret = secret
  @state  = state
  @user   = user
  @chip   = chip
end

Instance Attribute Details

#chipObject (readonly)

Returns the value of attribute chip.



5
6
7
# File 'lib/sso/client/passport.rb', line 5

def chip
  @chip
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/sso/client/passport.rb', line 5

def id
  @id
end

#secretObject (readonly)

Returns the value of attribute secret.



5
6
7
# File 'lib/sso/client/passport.rb', line 5

def secret
  @secret
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/sso/client/passport.rb', line 6

def state
  @state
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/sso/client/passport.rb', line 6

def user
  @user
end

Instance Method Details

#deltaObject



40
41
42
# File 'lib/sso/client/passport.rb', line 40

def delta
  { state: state, user: user }
end

#modified!Object



28
29
30
# File 'lib/sso/client/passport.rb', line 28

def modified!
  @modified = true
end

#modified?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/sso/client/passport.rb', line 32

def modified?
  @modified == true
end

#unmodified?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/sso/client/passport.rb', line 36

def unmodified?
  !modified?
end

#unverified?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/sso/client/passport.rb', line 24

def unverified?
  !verified?
end

#verified!Object



16
17
18
# File 'lib/sso/client/passport.rb', line 16

def verified!
  @verified = true
end

#verified?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/sso/client/passport.rb', line 20

def verified?
  @verified == true
end