module Stormpath::Resource::Associations

Public Instance Methods

get_resource_href_property(key) click to toggle source
    # File lib/stormpath-sdk/resource/associations.rb
103 def get_resource_href_property(key)
104   value = get_property key
105 
106   get_href_from_hash value if value.is_a? Hash
107 end
get_resource_property(key, clazz) click to toggle source
    # File lib/stormpath-sdk/resource/associations.rb
 84 def get_resource_property(key, clazz)
 85   value = get_property key
 86 
 87   return nil if value.nil? && (clazz != Stormpath::Resource::CustomData)
 88 
 89   resource_href = get_href_from_hash value if value.is_a? Hash
 90 
 91   key_name = "@_#{key.underscore}"
 92 
 93   if instance_variable_get(key_name).nil?
 94     if resource_href
 95       instance_variable_set(key_name, data_store.instantiate(clazz, value))
 96     else
 97       instance_variable_set(key_name, clazz.new(value))
 98     end
 99   end
100   instance_variable_get(key_name)
101 end