Sha256: 565d3d9f99c508779ce09d39074884a69ba7b61d39d427403b6f07ee3d4d5481

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

module Maestrano
  module SSO
    class BaseGroup
      attr_accessor :local_id
      attr_reader :uid,:country, :company_name, :free_trial_end_at, :has_credit_card
      
      # Initializer
      # @param Maestrano::SAML::Response
      def initialize(saml_response)
        att = saml_response.attributes
        @uid = att['group_uid']
        @has_credit_card = (att['group_has_credit_card'] == 'true')
        @country = att['country']
        @free_trial_end_at = Time.iso8601(att['group_end_free_trial'])
        @company_name = att['company_name']
      end
      
      def to_hash
        {
          provider: 'maestrano',
          uid: self.uid,
          info: {
            free_trial_end_at: self.free_trial_end_at,
            company_name: self.company_name,
            has_credit_card: self.has_credit_card,
            country: self.country,
          },
          extra: {}
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maestrano-0.10.0 lib/maestrano/sso/base_group.rb
maestrano-0.9.2 lib/maestrano/sso/base_group.rb
maestrano-0.9.1 lib/maestrano/sso/base_group.rb