Burgerlib Python
Loading...
Searching...
No Matches
Public Member Functions | List of all members
burger.validators.StringProperty Class Reference

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

Inheritance diagram for burger.validators.StringProperty:
Inheritance graph
[legend]
Collaboration diagram for burger.validators.StringProperty:
Collaboration graph
[legend]

Public Member Functions

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

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__()

def 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

Reimplemented from burger.validators.Property.