Method: Praxis::ResourceDefinition::ClassMethods#parse_href
- Defined in:
- lib/praxis/resource_definition.rb
#parse_href(path) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/praxis/resource_definition.rb', line 72 def parse_href(path) param_values = canonical_path.primary_route.path.params(path) attrs = canonical_path.params.attributes param_values.each_with_object({}) do |(key,value),hash| hash[key.to_sym] = attrs[key.to_sym].load(value,[key]) end rescue => e raise Praxis::Exception.new("Error parsing or coercing parameters from href: #{path}\n"+e.) end |