CrossClj

0.1.1 docs

SourceDocs



RECENT

    hyper-clj

    Clojars

    Jan 6, 2015


    OWNER
    Aaron Probus
    Funding Circle
    Berkeley

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    Hyper-Clj

    A Clojure library for representing hypermedia.

    Usage

    Create a representer like this

    (defhyper represent-book [book author]
      :item book
      :link-self (str "/books" (:id book))
      :embedded-author author
      :meta-info "Meta info")
    

    and then call it with

    (represent-book {:title "For Whom The Bell Tolls" :id 10} 
                    {:name "Ernest Hemingway"})
    

    which results in

    {:title "For Whom The Bell Tolls"
     :_links {:self {:href "/books/10"}}
     :_embedded {:author {:name "Ernest Hemingway"}}
     :_meta {:info "Meta info"}}
    

    Any meta/link/embedded is supported. Simply prepend the config with the appropriate word.

    License

    Copyright © 2015 FIXME

    Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.