module Authlete::Model::Hashable
Public Instance Methods
Source
# File lib/authlete/model/hashable.rb, line 40 def to_hash Hash[ instance_variables.map { |var| to_key_value_pair(var) } ] end
Private Instance Methods
Source
# File lib/authlete/model/hashable.rb, line 24 def to_hash_key(var) var.to_s.delete("@").to_sym end
Source
# File lib/authlete/model/hashable.rb, line 28 def to_hash_value(key, var) instance_variable_get(var) end
Source
# File lib/authlete/model/hashable.rb, line 32 def to_key_value_pair(var) key = to_hash_key(var) value = to_hash_value(key, var) [ key, value ] end