Class: ReclaimOidc::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reclaim_oidc.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, key, secret) ⇒ Client

Returns a new instance of Client.



98
99
100
101
102
# File 'lib/reclaim_oidc.rb', line 98

def initialize(name, key, secret)
  @name = name
  @key = key
  @secret = secret
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



97
98
99
# File 'lib/reclaim_oidc.rb', line 97

def description
  @description
end

#keyObject (readonly)

Returns the value of attribute key.



97
98
99
# File 'lib/reclaim_oidc.rb', line 97

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



97
98
99
# File 'lib/reclaim_oidc.rb', line 97

def name
  @name
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



97
98
99
# File 'lib/reclaim_oidc.rb', line 97

def redirect_uri
  @redirect_uri
end

#secretObject (readonly)

Returns the value of attribute secret.



97
98
99
# File 'lib/reclaim_oidc.rb', line 97

def secret
  @secret
end

Class Method Details

.from_json(obj) ⇒ Object



103
104
105
# File 'lib/reclaim_oidc.rb', line 103

def self.from_json(obj)
  id = Client.new(obj['name'], obj['pubkey'], obj['secret'])
end

Instance Method Details

#parse_client_info(obj) ⇒ Object



106
107
108
109
110
111
112
113
114
115
# File 'lib/reclaim_oidc.rb', line 106

def parse_client_info(obj)
  obj.each do |record|
    if (record['record_type'] == 'RECLAIM_OIDC_CLIENT')
      @description = record['value']
    end
    if (record['record_type'] == 'RECLAIM_OIDC_REDIRECT')
      @redirect_uri = record['value']
    end
  end
end