18F/e-manifest

View on GitHub
app/models/concerns/json_profile.rb

Summary

Maintainability
A
1 hr
Test Coverage
module JsonProfile
  extend ActiveSupport::Concern

  def profile_field(json_xpath)
    fields = json_xpath.split('.')
    if profile && fields.inject(profile) { |h,k| h[k] if h } 
      fields.inject(profile) { |h,k| h[k] if h } 
    end 
  end
end