lib/vacman_controller/token/properties.rb
def read_cast(property, value)
          # Short-circuit on 'NA'
          return nil if value == 'NA' or value == 'DISABLE'

          case property
          when  # Integer values
            'use_count',
            'pin_len',
            'pin_length',
            'pin_min_len',
            'pin_minimum_length',
            'last_time_shift',
            'virtual_token_remain_use',
            'error_count',
            'event_value',
            'last_event_value',
            'max_dtf_number',
            'response_len',
            'response_length',
            'time_step'
            value.to_i

          when # Boolean values
            'time_based_algo',
            'event_based_algo',
            'pin_supported',
            'unlock_supported',
            'pin_ch_on',
            'pin_change_enabled',
            'pin_enabled',
            'pin_ch_forced',
            'pin_change_forced',
            'sync_windows',
            'primary_token_enabled',
            'virtual_token_supported',
            'virtual_token_enabled',
            'derivation_supported',
            'response_chk',
            'response_checksum',
            'triple_des_used',
            'use_3des'

            case value
            when 'YES' then true
            when 'NO' then false
            end

          when # Date/time values
            'last_time_used',
            'virtual_token_grace_period'

            # AAL2 returns UTC values, we add the timezone.
            Time.strptime("#{value} UTC", '%a %b %d %H:%M:%S %Y %Z')

          when
            'auth_mode'

            case value
            when 'RO' then :response_only
            when 'SG' then :signature_application
            when 'CR' then :challenge_response
            when 'MM' then :multi_mode
            when 'UL' then :unlock_v2
            else
              value
            end

          else # String values

            value
          end
        end
# Maps the given property value to a Ruby value for:
#
# * Integers
# * Booleans
# * Dates
# * Enumerations (Symbols)
#
Maps the given property value to a Ruby value for:
Integers
Booleans
Dates
Enumerations (Symbols)
Maps the given property value to a Ruby value for : Integers Booleans Dates Enumerations ( Symbols )
def read_cast(property, value)
          return nil if value == 'NA' or value == 'DISABLE'
          case property
          when  
            'use_count',
            'pin_len',
            'pin_length',
            'pin_min_len',
            'pin_minimum_length',
            'last_time_shift',
            'virtual_token_remain_use',
            'error_count',
            'event_value',
            'last_event_value',
            'max_dtf_number',
            'response_len',
            'response_length',
            'time_step'
            value.to_i
          when 
            'time_based_algo',
            'event_based_algo',
            'pin_supported',
            'unlock_supported',
            'pin_ch_on',
            'pin_change_enabled',
            'pin_enabled',
            'pin_ch_forced',
            'pin_change_forced',
            'sync_windows',
            'primary_token_enabled',
            'virtual_token_supported',
            'virtual_token_enabled',
            'derivation_supported',
            'response_chk',
            'response_checksum',
            'triple_des_used',
            'use_3des'
            case value
            when 'YES' then true
            when 'NO' then false
            end
          when 
            'last_time_used',
            'virtual_token_grace_period'
            Time.strptime("#{value} UTC", '%a %b %d %H:%M:%S %Y %Z')
          when
            'auth_mode'
            case value
            when 'RO' then :response_only
            when 'SG' then :signature_application
            when 'CR' then :challenge_response
            when 'MM' then :multi_mode
            when 'UL' then :unlock_v2
            else
              value
            end
          else 
            value
          end
        end
def read_cast ( property , value ) return nil if value == 'NA' or value == 'DISABLE' case property when 'use_count' , 'pin_len' , 'pin_length' , 'pin_min_len' , 'pin_minimum_length' , 'last_time_shift' , 'virtual_token_remain_use' , 'error_count' , 'event_value' , 'last_event_value' , 'max_dtf_number' , 'response_len' , 'response_length' , 'time_step' value . to_i when 'time_based_algo' , 'event_based_algo' , 'pin_supported' , 'unlock_supported' , 'pin_ch_on' , 'pin_change_enabled' , 'pin_enabled' , 'pin_ch_forced' , 'pin_change_forced' , 'sync_windows' , 'primary_token_enabled' , 'virtual_token_supported' , 'virtual_token_enabled' , 'derivation_supported' , 'response_chk' , 'response_checksum' , 'triple_des_used' , 'use_3des' case value when 'YES' then true when 'NO' then false end when 'last_time_used' , 'virtual_token_grace_period' Time . strptime ( "#{value} UTC" , '%a %b %d %H:%M:%S %Y %Z' ) when 'auth_mode' case value when 'RO' then :response_only when 'SG' then :signature_application when 'CR' then :challenge_response when 'MM' then :multi_mode when 'UL' then :unlock_v2 else value end else value end end
Maps the given property value to a Ruby value for:
 Integers
 Booleans
 Dates
 Enumerations (Symbols)
Maps the given property value to a Ruby value for : Integers Booleans Dates Enumerations ( Symbols )
# Short-circuit on 'NA' # Integer values # Boolean values # Date/time values # AAL2 returns UTC values, we add the timezone. # String values
property
value