app/controllers/api_controller/policies.rb
#
# Policies and Policy Profiles Subcollection Supporting Methods
#
Policies and Policy Profiles Subcollection Supporting Methods
Policies and Policy Profiles Subcollection Supporting Methods
def parse_policy(data, collection, klass)
      return {} if data.blank?
      guid = data["guid"]
      return klass.find_by_guid(guid) if guid.present?
      href = data["href"]
      href.match(%r{^.*/#{collection}/[0-9]+$}) ? klass.find(href.split('/').last) : {}
    end
def parse_policy ( data , collection , klass ) return { } if data . blank? guid = data [ "guid" ] return klass . find_by_guid ( guid ) if guid . present? href = data [ "href" ] href . match ( %r{ ^.*/ #{ collection } /[0-9]+$ } ) ? klass . find ( href . split ( '/' ) . last ) : { } end
Policies and Policy Profiles Subcollection Supporting Methods
Policies and Policy Profiles Subcollection Supporting Methods
data
<not_specific>
collection
<not_specific>
klass
<not_specific>