class Tinypass::TokenData

Constants

ACCESS_ID
EARLY_EX
EX
IPS
MARK_YEAR_MILLIS
METER_LOCKOUT_ENDTIME
METER_LOCKOUT_PERIOD
METER_REMINDER
METER_STRICT
METER_TRIAL_ACCESS_ATTEMPTS
METER_TRIAL_ACCESS_PERIOD
METER_TRIAL_ENDTIME
METER_TRIAL_MAX_ACCESS_ATTEMPTS
METER_TYPE
RID
UID

Public Class Methods

convert_to_epoch_seconds(seconds_from_now) click to toggle source
# File lib/tinypass/token/token_data.rb, line 67
def self.convert_to_epoch_seconds(seconds_from_now)
  seconds_from_now /= 1000 if seconds_from_now > MARK_YEAR_MILLIS
  seconds_from_now
end
new(data = {}) click to toggle source
# File lib/tinypass/token/token_data.rb, line 26
def initialize(data = {})
  @data = data
end

Public Instance Methods

[](key) click to toggle source
# File lib/tinypass/token/token_data.rb, line 34
def [](key)
  key = key.to_s
  @data[key]
end
[]=(key, value) click to toggle source
# File lib/tinypass/token/token_data.rb, line 39
def []=(key, value)
  key = key.to_s
  @data[key] = value
end
add_fields(hash)
Alias for: merge
fetch(*args) click to toggle source
# File lib/tinypass/token/token_data.rb, line 48
def fetch(*args)
  args[0] = args[0].to_s
  @data.fetch(*args)
end
merge(hash) click to toggle source
# File lib/tinypass/token/token_data.rb, line 53
def merge(hash)
  stringified_hash = {}
  hash.keys.each do |key|
    stringified_hash[key.to_s] = hash[key]
  end

  @data.merge!(stringified_hash)
end
Also aliased as: add_fields
rid() click to toggle source
# File lib/tinypass/token/token_data.rb, line 30
def rid
  @data[RID]
end
size() click to toggle source
# File lib/tinypass/token/token_data.rb, line 63
def size
  @data.size
end
values() click to toggle source
# File lib/tinypass/token/token_data.rb, line 44
def values
  @data
end