import json


def from_json_string(s, object_hook):
    """
    Given the string as json, loads it into a nested dictionary and passes it into the object_ctor
    provided to yield an instance of the object
    :param s: A json formatted string
    :param object_hook: A function that takes a dictionary and yields a new object instance
    :return: A populated object instance generated from the object_ctor
    """
    d = json.loads(s)
    return object_hook(d)