Burgerlib Python
Loading...
Searching...
No Matches
burger.validators.StringProperty Class Reference

Class to enforce string in member variable. More...

Inheritance diagram for burger.validators.StringProperty:
Collaboration diagram for burger.validators.StringProperty:

Public Member Functions

 __set__ (self, instance, value)
 Set the string value.
Public Member Functions inherited from burger.validators.Property
 __init__ (self, name)
 Initialize to default.
 __get__ (self, instance, owner=None)
 Return value.
 __set__ (self, instance, value)
 Set the string value.

Additional Inherited Members

Protected Attributes inherited from burger.validators.Property
 _name = name
 The real name of the class instance.

Detailed Description

Class to enforce string in member variable.

Examples

"Inherit from (object) for Python 2.7"
>>> class foo(object):
"Init to \"foo\""
x = StringProperty("foo")
"Init to None"
y = StringProperty()
"Create the class"
f = foo()
"Print foo"
print(f.x)
"Print False"
f.x = "False"
print(f.x)
"Print True"
f.x = True
print(f.x)

Member Function Documentation

◆ __set__()

burger.validators.StringProperty.__set__ ( self,
instance,
value )

Set the string value.

Parameters
instanceReference to object containing data
valueNone or value the can be converted to bool