Sha256: 2ebd18fcf3fd0b4ff3f15ad3ea4360bf7f66c4c1b42070ac3b5f210bc4ce5eed

Contents?: true

Size: 498 Bytes

Versions: 6

Compression:

Stored size: 498 Bytes

Contents

require 'ostruct'

module Doorkeeper
  module OpenidConnect
    class ClaimsBuilder
      def initialize(&block)
        @claims = OpenStruct.new
        instance_eval(&block)
      end

      def build
        @claims
      end

      def normal_claim(name, scope: nil, &block)
        @claims[name] =
          Claims::NormalClaim.new(
            name: name,
            scope: scope,
            generator: block
          )
      end
      alias_method :claim, :normal_claim
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
doorkeeper-openid_connect-1.4.0 lib/doorkeeper/openid_connect/claims_builder.rb
doorkeeper-openid_connect-1.3.0 lib/doorkeeper/openid_connect/claims_builder.rb
doorkeeper-openid_connect-1.2.0 lib/doorkeeper/openid_connect/claims_builder.rb
doorkeeper-openid_connect-1.1.2 lib/doorkeeper/openid_connect/claims_builder.rb
doorkeeper-openid_connect-1.1.1 lib/doorkeeper/openid_connect/claims_builder.rb
doorkeeper-openid_connect-1.1.0 lib/doorkeeper/openid_connect/claims_builder.rb