Package Pyblio :: Package Format :: Module DSL :: Class switch
[hide private]
[frames] | no frames]

Class switch

source code

object --+    
         |    
      Glue --+
             |
            switch

The switch operator helps in bringing together multiple citation parts, according to the value of a Txo.
>>> citation = switch('doctype')
>>> citation.case(ARTICLE=article, BOOK=book)
>>> citation.default(default)


Instance Methods [hide private]
 
__init__(self, switch, _cases={}, _default=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
case(self, **kargs) source code
 
default(self, v) source code
 
__repr__(self)
repr(x)
source code
 
__call__(self, db, props={}) source code

Inherited from Glue: __add__, __or__, __radd__, __ror__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, switch, _cases={}, _default=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)