Liking cljdoc? Tell your friends :D

hara.object.framework


invoke-intern-objectclj

(invoke-intern-object name config body)
(invoke-intern-object _
                      name
                      {:keys [type extend tag read write display] :as config}
                      body)

creates an invoke form for an object

(framework/invoke-intern-object '-cl-context- {:type org.eclipse.jgit.lib.PersonIdent :tag "person" :exclude [:time-zone]} '([] nil))

creates an invoke form for an object

(framework/invoke-intern-object
 '-cl-context-
 {:type org.eclipse.jgit.lib.PersonIdent
  :tag "person"
 :exclude [:time-zone]}
 '([] nil))
raw docstring

map-likecljmacro

(map-like & {:as classes})

creates an accessibility layer for map-like objects

(framework/map-like org.eclipse.jgit.revwalk.RevCommit {:tag "commit" :include [:commit-time :name :author-ident :full-message]})

(framework/map-like org.eclipse.jgit.lib.PersonIdent {:tag "person" :exclude [:time-zone]})

(framework/map-like org.eclipse.jgit.api.Status {:tag "status" :display (fn [m] (reduce-kv (fn [out k v] (if (and (or (instance? java.util.Collection v) (instance? java.util.Map v)) (empty? v)) out (assoc out k v))) {} m))})

creates an accessibility layer for map-like objects

(framework/map-like
 org.eclipse.jgit.revwalk.RevCommit
 {:tag "commit"
  :include [:commit-time :name :author-ident :full-message]})

(framework/map-like
 org.eclipse.jgit.lib.PersonIdent
 {:tag "person"
  :exclude [:time-zone]})

(framework/map-like
 org.eclipse.jgit.api.Status
 {:tag "status"
  :display (fn [m]
             (reduce-kv (fn [out k v]
                          (if (and (or (instance? java.util.Collection v)
                                      (instance? java.util.Map v))
                                   (empty? v))
                            out
                            (assoc out k v)))
                        {}
                        m))})
raw docstring

string-likecljmacro

(string-like & {:as classes})

creates an accessibility layer for string-like objects

(framework/string-like java.io.File {:tag "path" :read (fn [f] (.getPath f)) :write (fn [^String path] (java.io.File. path))})

(object/to-data (java.io.File. "/home")) => "/home"

(object/from-data "/home" java.io.File) => java.io.File

;; Enums are automatically string-like

(object/to-data java.lang.Thread$State/NEW) => "NEW"

creates an accessibility layer for string-like objects

(framework/string-like
 java.io.File
 {:tag "path"
  :read (fn [f] (.getPath f))
  :write (fn [^String path] (java.io.File. path))})

(object/to-data (java.io.File. "/home"))
=> "/home"

(object/from-data "/home" java.io.File)
=> java.io.File

;; Enums are automatically string-like

(object/to-data java.lang.Thread$State/NEW)
=> "NEW"
raw docstring

unextendclj

(unextend cls)

unextend a given class from the object framework

(framework/unextend org.eclipse.jgit.lib.PersonIdent) ;;=> [[#multifn[-meta-read 0x4ead3109] nil #multifn[print-method 0xcd219d4]]]

unextend a given class from the object framework

(framework/unextend org.eclipse.jgit.lib.PersonIdent)
;;=> [[#multifn[-meta-read 0x4ead3109] nil #multifn[print-method 0xcd219d4]]]
raw docstring

vector-likecljmacro

(vector-like & {:as classes})

creates an accessibility layer for vector-like objects

(framework/vector-like org.eclipse.jgit.revwalk.RevWalk {:tag "commits" :read (fn [^org.eclipse.jgit.revwalk.RevWalk walk] (->> walk (.iterator) object/to-data))})

creates an accessibility layer for vector-like objects

(framework/vector-like
 org.eclipse.jgit.revwalk.RevWalk
{:tag "commits"
  :read (fn [^org.eclipse.jgit.revwalk.RevWalk walk]
          (->> walk (.iterator) object/to-data))})
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close